replica nfl jerseysreplica nfl jerseyssoccer jerseyreplica nfl jerseys forums.silverfrost.com :: View topic - Autotabbing between fields, for example DD MM YY
forums.silverfrost.com Forum Index forums.silverfrost.com
Welcome to the Silverfrost forums
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Autotabbing between fields, for example DD MM YY

 
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> General
View previous topic :: View next topic  
Author Message
Steve



Joined: 23 Feb 2007
Posts: 73

PostPosted: Fri Jun 24, 2011 5:19 pm    Post subject: Autotabbing between fields, for example DD MM YY Reply with quote

I am wanting to auto-tab between fields when a field gets filled.

For example entering Date of Birth when each of the DD MM YY fields has 2 characters the user should expect to immediately key them in without having to Tab between them.

I realise that a callback can be done and therefore a check performed on the number of characters keyed in. But, how does one inform Clearwin+/Windows to effectively "auto-tab to the next field" ?
Back to top
View user's profile Send private message
LitusSaxonicum



Joined: 23 Aug 2005
Posts: 2402
Location: Yateley, Hants, UK

PostPosted: Tue Jun 28, 2011 1:03 pm    Post subject: Reply with quote

I have puzzled over this in the past - but gave up. The problem is that "auto-tabbing" is a bit unconventional in Windows.

As far as I got (before I gave up) was to find on MSDN that there was a SetFocus function so that you could set the focus to any control for which you had the handle (MSDN talks about windows, but a control is also a window in MSDN language!). You could call this in the callback after you checked that the 2 characters were admissable, and get the handle for every control with %lc.

However (and this is what really stopped me in my tracks) was the note that said not to use the function, but instead, CALL SendMessage so that internal bookkeeping was updated.

Perhaps you will get further than I did by Googling "SetFocus" and "MSDN" together!

Eddie

EDIT: When I said "get the focus", I meant "get the handle" - sorry. Corrected above in red.


Last edited by LitusSaxonicum on Wed Jun 29, 2011 9:07 am; edited 1 time in total
Back to top
View user's profile Send private message
PaulLaidler
Site Admin


Joined: 21 Feb 2005
Posts: 8210
Location: Salford, UK

PostPosted: Tue Jun 28, 2011 5:15 pm    Post subject: Reply with quote

I would use %lc and SetFocus which you should find listed in win32api.ins.
Back to top
View user's profile Send private message AIM Address
Steve



Joined: 23 Feb 2007
Posts: 73

PostPosted: Sun Jul 03, 2011 10:49 pm    Post subject: Reply with quote

Many thanks, your suggestions work fine.
Back to top
View user's profile Send private message
LitusSaxonicum



Joined: 23 Aug 2005
Posts: 2402
Location: Yateley, Hants, UK

PostPosted: Mon Jul 04, 2011 8:29 pm    Post subject: Reply with quote

Steve,

Did you manage it with %lc and SetFocus, as I first thought and Paul advised? Did you get the reputed side effects, and was it necessary therefore to resort to SendMessage? If so, how did the side effects (if any) manifest in an FTN95 program!

Eddie
Back to top
View user's profile Send private message
Steve



Joined: 23 Feb 2007
Posts: 73

PostPosted: Sun Jul 24, 2011 5:07 pm    Post subject: Reply with quote

Eddie,

Sorry did not get back to you earlier. Setting up %lc for the MM and YY fields and then having a callback on the DD and MM which SetFocus to the next field when 2 characters were identified. Very straight forward and worked first time and with no "side effects" ( latter not understood ).

Thanks for your input.
Back to top
View user's profile Send private message
LitusSaxonicum



Joined: 23 Aug 2005
Posts: 2402
Location: Yateley, Hants, UK

PostPosted: Sun Jul 24, 2011 6:21 pm    Post subject: Reply with quote

Steve,

I didn't understand "side effects" either. MSDN says this:

Quote:
When handling other dialog messages if you use SetFocus (and not WM_NEXTDLGCTL) it prevents the dialog manager from updating its internal bookkeeping. For example, it might cause the dialog manager to display the wrong default pushbutton or fail to select the text of an edit control. For details see Raymond Chen's book The Old New Thing, page 227, "How to set focus in a dialog box." (Or see his blog.)


Whatever that means! (It was enough to put me off ....)

You can get to the "official" MSDN explanation by Googling SetFocus and MSDN together. (And try Googling Raymond Chen blog SetFocus!)

Eddie
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> General All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group