Few Questions

This forum can be browsed by the general public. Posting is no longer allowed as the product has been discontinued.
User avatar
squid808
Posts: 5
Meble kuchenne na zamówienie - na wymiar - Wrocław
Joined: Tue Sep 20, 2011 2:40 am

Few Questions

Post by squid808 »

First off, I wanted to say thanks - this product is great and so far VERY useful.

However I have a few questions.

1) How the heck do I get the mnemonics to do anything? I've added them to buttons and labels, and was hoping to have them do something when hitting alt-O or whatever.

2) How do I make an event handler change focus? For instance, when I click a button I would like focus to move to a control in another tab, or like in 1 when hitting alt-O I want focus to go to a certain control.

3) Do fields in separate tabs conflict with each other? Let's say I have a UserName text box in tab 1 and a UserName text box in tab 2. Tab 1 Creates users, tab 2 searches for users. Do I have to make the variable name different for each one? Or will the names stay local to that tab?

Thanks!

User avatar
davidc
Posts: 5913
Joined: Thu Aug 18, 2011 4:56 am

Few Questions

Post by davidc »



I'm
assuming you are referring to PrimalForms Community Edition :).
1.
In the Text property of a
button, set the
David
SAPIEN Technologies, Inc.

User avatar
squid808
Posts: 5
Joined: Tue Sep 20, 2011 2:40 am

Few Questions

Post by squid808 »

Hi David, thanks for the prompt reply! Yeah, I meant PrimalFormsCE, though I'm playing around with a trial of PrimalForms2011 - now if only I can get my boss to pay for a copy =)

for 1) I already have the ampersand there, but it doesn't seem to do anything. For instance, I have an '&Add' button which I would assume would mimic being pressed when I hit Alt-A. But... nothing happens. The underscore comes up under the A in the form, but nothing else. I figured there was an event or something I was just plain not seeing.

2) Good to know! I was afraid 'CausesValidation' was the only focus-type property there was, as I didn't see any others in the list. For this kind of stuff, should I be googling WinForms for additional references to properties that are available?

3) I figured. I already adopted a naming convention to avoid conflicts, based on the tab, so that means it wasn't wasted time =)

Cheers,
squid808

User avatar
Ferdinand Rios
Posts: 373
Joined: Tue Nov 14, 2006 2:56 am

Few Questions

Post by Ferdinand Rios »

Well, during the month of Sept, all SAPIEN products are 25% off on our store (http://store.sapien.com) so now is the time!frios2011-09-20 11:55:50
F.G. Rios

User avatar
davidc
Posts: 5913
Joined: Thu Aug 18, 2011 4:56 am

Few Questions

Post by davidc »



1) The
button needs to have a "Click" event script block, that will run when
the button is clicked or when the accelerator is pressed. You can add an event
via the Context Menu (Right click -> Add Events) or double click on the
Button to add the default Click event. You can also add events via the Property
panel by pressing the lightning button and a list of the events for the
selected control will be displayed.

You
can add a simple Write-Host
David
SAPIEN Technologies, Inc.

User avatar
squid808
Posts: 5
Joined: Tue Sep 20, 2011 2:40 am

Few Questions

Post by squid808 »

Ah, there was information in the first Spotlight - I didn't ever read that one as I assumed it was just an intro. My bad, there.

I've been able to get the Focus() working, when being used on a button, for example. However I still can't seem to get the Mnemonics working for the labels... I've tried adding a Click event, but no dice.

Maybe I'm using it wrong?

User avatar
davidc
Posts: 5913
Joined: Thu Aug 18, 2011 4:56 am

Few Questions

Post by davidc »

It only works for Buttons and MenuItems that typically have a click event. Is there a reason you want to add a click event to a Label? David
David
SAPIEN Technologies, Inc.

User avatar
Ferdinand Rios
Posts: 373
Joined: Tue Nov 14, 2006 2:56 am

Few Questions

Post by Ferdinand Rios »

There are properties that you can set on a button that makes it "look" more like a label. I am not sure about .NET but I seem to recall (maybe incorrectly) that with VB, labels did not have the ability to get the focus. It would automatically forward the focus to the next control. So a label in front of a text box would pass the focus to the text box.
F.G. Rios

User avatar
squid808
Posts: 5
Joined: Tue Sep 20, 2011 2:40 am

Few Questions

Post by squid808 »

Ooooooooh... I saw the property for the Label and assumed that meant I could associate it with something. If it can't be done, then that'd explain a lot.

I had a label next to a Text Box, I thought I could use the mnemonics for the Label to give focus to the text box, since it didn't have text in it (and that text changes).

So then... what would the point of the mnemonic property on a label if you can't associate or redirect that to something else?

User avatar
Ferdinand Rios
Posts: 373
Joined: Tue Nov 14, 2006 2:56 am

Few Questions

Post by Ferdinand Rios »

This worked for me:

1) reate a label and a text box
2) set the Text property of the label e.g. &Type Here
3) Set the UseNemonic property of label to True
4) Set the TabIndex of the Label to 0
5) set the TabIndex of the TextBox to 1
6) Set the TabStop of the text box to TRUE

Run the app. The important issues are that the tab index of the text box be immediately after that of the label. When the Nemonic is used, the focus skips the label (because it does NOT have a TabSTOP property) and goes to the NEXT item in the TABStop chain. I tried this here and it works.
F.G. Rios

Locked