473,804 Members | 2,148 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

DataGrid Get F3 keypress

I design my own datagrid which can turn Enter into 'Tab', BUT I cannot
detect the user keypress 'F3' , Why
I try to detect keyCode, it only effect on 'keydown' , 'keyup' , but it
cannot get my keypress 'FX'
Anybody got idea ? thanks a lot

Protected Overrides Function ProcessKeyPrevi ew(ByRef m As
System.Windows. Forms.Message) As Boolean
Dim keyCode As Keys = CType(m.WParam. ToInt32(), Keys) And
Keys.KeyCode
If m.Msg = WM_KEYDOWN And keyCode = Keys.Enter Then
m.WParam = New IntPtr(Keys.Tab )
endif
end function
Nov 21 '05 #1
1 2164
I got the solution , I should use the following method
Protected Overrides Function ProcessCmdKey(B yRef msg As
System.Windows. Forms.Message, ByVal keyData As System.Windows. Forms.Keys) As
Boolean

"Agnes" <ag***@dynamict ech.com.hk> ¦b¶l¥ó
news:uz******** ******@TK2MSFTN GP12.phx.gbl ¤¤¼¶¼g...
I design my own datagrid which can turn Enter into 'Tab', BUT I cannot
detect the user keypress 'F3' , Why
I try to detect keyCode, it only effect on 'keydown' , 'keyup' , but it
cannot get my keypress 'FX'
Anybody got idea ? thanks a lot

Protected Overrides Function ProcessKeyPrevi ew(ByRef m As
System.Windows. Forms.Message) As Boolean
Dim keyCode As Keys = CType(m.WParam. ToInt32(), Keys) And
Keys.KeyCode
If m.Msg = WM_KEYDOWN And keyCode = Keys.Enter Then
m.WParam = New IntPtr(Keys.Tab )
endif
end function

Nov 21 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
16323
by: Byron McClain | last post by:
.... is being consumed. I added an event handler for the "keypress" event and my delegate never gets executed. Why? I am trying to catch the "enter" key pressed event to prevent the DataGrid from going to currentRow + 1. Instead I want it to give focus to the next cell (currentCol + 1) to the right if not at the end of the row. Example:
0
3193
by: Morné | last post by:
Hi how do I validate a text value in a datagrid e.g. the user is only allowed to type in a Y or a N. I specifically have a problem with using the PropertyDescriptorCollection. I get the following error: "Additional information: Cannot create a child list for field Query." Below my existing code:
4
1945
by: Gidi | last post by:
Hello i'm writing a C# Window appliction and i'm using DataGrid as a table i want the user to enter data in each column and by pressing the enter key to move to the next column how can i write it how do i write the event (pressing the enter key) and how can i move to the next column thank you
1
3226
by: ray well | last post by:
hi, i need to preview the keys in my app in order to process F1-F10. i set keypreview of my form to true, and it does capture the keystrokes from all over the forms controls which i then process. i found 2 puzzeling exception: if the user is inside the text box of a ComboBox, the keystrokes aren't captured in the form's keypress event. i have to separately capture the
1
1688
by: Gidi | last post by:
Hi, I have DataGrid and i want to use the arrows to navigate up and down between the lines. i also want that each row i'm in, will be marked (as in DataGrid.Select(row_number)). When my form is loaded, my focus is on a textbox i have, and what i want to do is that if i press the arrows keys the focus will be on the dataGrid (on the next row) and while i'll navigate with arrows, the row i will be in will be totaly marked. how can i do...
9
3809
by: robert_rowe | last post by:
Does anyone know how to detect keypresses in a Datagrid cell? The Keypress event ofthe datagrid doesn't fire if you are in a cell. Neither does KeyUp & KeyDown. I've tried hooking in to the DataGridCell events but it doesn't have the keypress event. Robert
3
3074
by: Terry Olsen | last post by:
Is there anyway to cause a KeyPress event in a datagrid cell? The only way I get a keypress event is if none of the cells are selected. I was hoping to have the program respond to a certain keypress while in a cell of a datagrid but it doesn't fire the keypress event.
4
10513
by: Melson | last post by:
Hi I've a problem. Can anyone help. I would like to use datagrid for data entry. How can I set the number of rows in the datagrid. And use the datagrid to update the ms sql table. regards melson
2
272
by: Starbuck | last post by:
Hi Using VB.Net. We have a datagrid which users can type data directly into, all seems to work fine but what we want is when a user changes a numeric value in column 3 or 4 (via keypress) we want to call a routine that will change some data on the screen. What is the best way of catching the keypress and column number please. Thanks
2
5561
by: chatelain | last post by:
Ok a couple things I've got going: On the DataGrid1_CurrentCellChanged I add a button control to the datagridtextbox. This occurs when a mouse click happens inside the cell or the cursor enters the cell. I'm trying to figure out how to capture the Enter key so to run the buttoncontrol click function. I can get this to work when the datagrid only is activated (by clicking on the whitespace of the grid) but of course it won't work when the cursor...
0
9594
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10595
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10343
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10341
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
6862
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5673
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4308
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3831
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3001
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.