Navigation using the enter key...


Author
Message
Trent Taylor
Trent Taylor
StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)
Group: StrataFrame Developers
Posts: 6.6K, Visits: 6.9K
This should all be in a base form anyway.  This logic should be trigger by a property that is exposed on a your base form that all of your other forms inherit (i.e. EnterIsSameActionAsTab).  When true, you would then allow the Enter to act as a tab.  I think you are trying to make this too complicated.  I did this in minutes as a quick test and it worked.  Just Override the ProcessCmd method on the base form, if the property mentioned above is True, then handle the Enter.  In the Enter, call another private method in your base form that selects the next control.
StarkMike
StarkMike
StrataFrame User (448 reputation)StrataFrame User (448 reputation)StrataFrame User (448 reputation)StrataFrame User (448 reputation)StrataFrame User (448 reputation)StrataFrame User (448 reputation)StrataFrame User (448 reputation)StrataFrame User (448 reputation)StrataFrame User (448 reputation)
Group: Forum Members
Posts: 436, Visits: 944
We've noticed that when we add this code to an existing form it will move it to the first place on the tab order then wont move any further. The tab key still functions properly...just not the enter key.



However when we create a new form and add this code and controls to it, it works fine... weird.



Any suggestions?
Trent Taylor
Trent Taylor
StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)
Group: StrataFrame Developers
Posts: 6.6K, Visits: 6.9K
This is basically what Greg suggested but doing it at the form level instead of the field level.  ProcessTabKey just executes the underlying Tab code which generally takes the current control that youa re in and calls the SelectNext() methods.  But at any rate, glad you got it going.
StarkMike
StarkMike
StrataFrame User (448 reputation)StrataFrame User (448 reputation)StrataFrame User (448 reputation)StrataFrame User (448 reputation)StrataFrame User (448 reputation)StrataFrame User (448 reputation)StrataFrame User (448 reputation)StrataFrame User (448 reputation)StrataFrame User (448 reputation)
Group: Forum Members
Posts: 436, Visits: 944
Hey Greg... Thanks for the post but this is what i was looking for... I dont *quite* understand it but it works! ha ha



Protected Overloads Overrides Function ProcessDialogKey(ByVal keyData As Keys) As Boolean

If keyData = Keys.Enter Then

MyBase.ProcessTabKey(CBool(Keys.Tab))

Return True

End If



Return MyBase.ProcessDialogKey(keyData)



End Function



I included this link in case someone wanted more information that I could provide! :-D





http://www.duncanmackenzie.net/blog/517/default.aspx
Greg McGuffey
Greg McGuffey
Strategic Support Team Member (3.3K reputation)
Group: Forum Members
Posts: 2K, Visits: 6.6K
I think this may be what you're after...

http://forum.strataframe.net/FindPost15165.aspx
StarkMike
StarkMike
StrataFrame User (448 reputation)StrataFrame User (448 reputation)StrataFrame User (448 reputation)StrataFrame User (448 reputation)StrataFrame User (448 reputation)StrataFrame User (448 reputation)StrataFrame User (448 reputation)StrataFrame User (448 reputation)StrataFrame User (448 reputation)
Group: Forum Members
Posts: 436, Visits: 944
My users prefer using the enter key instead of the tab key for field navigation on the form... instead of creating KeyUp events for EVERY control does somebody know of a better / easier way?



Thanks
GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search