StrataFrame Forum
Home      Members   Calendar   Who's On
Welcome Guest ( Login | Register )
      



Navigation using the enter key...Expand / Collapse
Author
Message
Posted 06/05/2008 2:35:58 PM


StrataFrame User

StrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame User

Group: StrataFrame Users
Last Login: 07/09/2008 2:20:16 PM
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
Post #16866
Posted 06/05/2008 5:37:36 PM
StrataFrame VIP

StrataFrame VIPStrataFrame VIPStrataFrame VIPStrataFrame VIPStrataFrame VIPStrataFrame VIPStrataFrame VIPStrataFrame VIP

Group: StrataFrame Users
Last Login: 09/05/2008 7:31:07 PM
Posts: 1,241, Visits: 3,131
I think this may be what you're after...
http://forum.strataframe.net/FindPost15165.aspx
Post #16871
Posted 06/06/2008 7:38:11 AM


StrataFrame User

StrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame User

Group: StrataFrame Users
Last Login: 07/09/2008 2:20:16 PM
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
Post #16876
Posted 06/06/2008 8:23:23 AM


StrataFrame Developer

StrataFrame Developer

Group: StrataFrame Developers
Last Login: Today @ 5:39:40 AM
Posts: 4,379, Visits: 4,422
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.
Post #16877
Posted 06/06/2008 11:05:25 AM


StrataFrame User

StrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame User

Group: StrataFrame Users
Last Login: 07/09/2008 2:20:16 PM
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?
Post #16883
Posted 06/06/2008 2:21:19 PM


StrataFrame Developer

StrataFrame Developer

Group: StrataFrame Developers
Last Login: Today @ 5:39:40 AM
Posts: 4,379, Visits: 4,422
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.
Post #16889
« Prev Topic | Next Topic »


Reading This TopicExpand / Collapse
Active Users: 0 (0 guests, 0 members, 0 anonymous members)
No members currently viewing this topic.
Forum Moderators: Ben Chase, Trent L. Taylor, Steve L. Taylor

PermissionsExpand / Collapse

All times are GMT -6:00, Time now is 6:57am

Powered by InstantForum.NET v4.1.4 © 2008
Execution: 0.063. 10 queries. Compression Enabled.
Site Map - Home - My Account - Forum - About Us - Contact Us - Try It - Buy It

Microsoft, Visual Studio, and the Visual Studio logo are trademarks or registered trademarks of Microsoft Corporation in the United States and/or other countries.