HighTechTalks DotNet Forums  

vb .net keydown event question

Dotnet Framework (WinForms Controls) microsoft.public.dotnet.framework.windowsforms.controls


Discuss vb .net keydown event question in the Dotnet Framework (WinForms Controls) forum.



Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old   
Herfried K. Wagner [MVP]
 
Posts: n/a

Default Re: vb .net keydown event question - 01-02-2008 , 06:47 AM






"kamran" <kamran_azad1 (AT) yahoo (DOT) com> schrieb:
Quote:
can someone plz tell me how can i use keydown event on my vb .net form to
trigger som action

the code is listed below but it does not act when i press F4 button.
Maybe you forgot to set the form's 'KeyPreview' property to 'True'.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>



Reply With Quote
  #2  
Old   
kamran
 
Posts: n/a

Default vb .net keydown event question - 01-02-2008 , 04:48 PM






Hi!

can someone plz tell me how can i use keydown event on my vb .net form to
trigger som action

the code is listed below but it does not act when i press F4 button.

what's wrong with me

thannks in advance

Private Sub Frmcustomers_KeyDown(ByVal sender As Object, ByVal e As
System.Windows.Forms.KeyEventArgs) Handles Me.KeyDown

If e.KeyCode = Keys.F4 Then

MsgBox("something")

End If

End Sub



Reply With Quote
  #3  
Old   
kamran
 
Posts: n/a

Default Re: vb .net keydown event question - 01-03-2008 , 01:28 PM



thank you sir
it really worked.
i forgot to set keypreview property to true and thanks to your guide it
worked.

best wishes and happy new year



"Herfried K. Wagner [MVP]" <hirf-spam-me-here (AT) gmx (DOT) at> wrote

Quote:
"kamran" <kamran_azad1 (AT) yahoo (DOT) com> schrieb:
can someone plz tell me how can i use keydown event on my vb .net form to
trigger som action

the code is listed below but it does not act when i press F4 button.

Maybe you forgot to set the form's 'KeyPreview' property to 'True'.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/
V B <URL:http://dotnet.mvps.org/dotnet/faqs/



Reply With Quote
Reply




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.