Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / Compact Framework / May 2008

Tip: Looking for answers? Try searching our database.

Reassigning the soft keys

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Hugh Janus - 22 May 2008 11:53 GMT
Hi all,

I am using VB2005 to write a program for Windows Mobile 5.

I have removed the control mainmenu from my form and I now need to
capture the keypress for when a user presses the left soft key (which
says "Start" on the main Windows screen) and the right soft key (which
says "Contacts" on the main windows screen).

Does anyone know how to do this?  I have managed to capture the
pressing of the back key with this code, but I cannot work out the
code for the 2 soft keys:

If e.KeyChar = ChrW(Keys.Escape) Then

   Debug.WriteLine("back")
   e.Handled = True

End If

Thanks in advance
Hugh Janus - 23 May 2008 09:57 GMT
> Hi all,
>
[quoted text clipped - 17 lines]
>
> Thanks in advance

Sigh, I found the answer and it really is utter stupidity by MS for
doing this.

I found a page on MSDN that told me that the left key is F1 and the
right one is F2.  However, when I placed the code on my form I could
not get it to work.  The reason is simple, I had used the KeyPress
event rather than the KeyDown event.  When I switched to the KeyDown
event the code worked and detected an F1 button being pressed.

Totally undocumented and inconsistent with the KeyPress event.

So I am posting the answer here to stop other people losing over a day
of their life on something as stupid as this.

Hugh

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.