• Welcome to PlanetSquires Forums.
 

tabs within a form

Started by raymw, February 14, 2017, 07:05:54 PM

Previous topic - Next topic

raymw

Having set the tab order of controls on a form in the form designer, is it possible to get/set the tab numbers of the controls, so that I can tab to the next control on the form, within software? If so, how? I can tab around OK using the tab key on keyboard, but would like to do that from a button on another form.Thanks.

Paul Squires

#1
You would need to use the GetNextDlgTabItem api. https://msdn.microsoft.com/en-us/library/windows/desktop/ms645495(v=vs.85).aspx if you want to programmically move from control to control within the tab order.

If you want to manually set focus to a control, then, well, you'd use the SetFocus api or the FF_CONTROL_SETFOCUS wrapper.
Paul Squires
PlanetSquires Software
WinFBE Editor and Visual Designer

raymw

Thanks for the link. It does what I wanted to do, but not as described 'on the tin', so to speak. Interesting that their explanation is flawed, in as much as null is allowed for second entry. I've also found that the third value 'bPrevious' (true/false) is inverted - e.g. false is for previous tab. It may be that there is a difference between how true is implemented by c++ cf  freebasic e.g., if true is one, and false is zero, then if in their code they have false as not true, that can be different than true being not false, depending on the 'not' and how much of the assigned 8 bits are used, or maybe they've just described it incorrectly. Anyway, other than that, two errors in three, that's too bad... ;)

Paul Squires

Are you sure that you have your TAB order correctly set to begin with using the FireFly Tab Order listbox?
Paul Squires
PlanetSquires Software
WinFBE Editor and Visual Designer

raymw

I was sure, very sure, in fact, hence my posting here, I had initially checked a number of times, but I now see that indeed the order was reversed. I'll go and stand in the naughty corner. :(

Paul Squires

:)  lol

We all get sent to the naughty corner every now and again.

Paul Squires
PlanetSquires Software
WinFBE Editor and Visual Designer