473,486 Members | 1,597 Online
Bytes | Software Development & Data Engineering Community
Create 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 ProcessKeyPreview(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 2129
I got the solution , I should use the following method
Protected Overrides Function ProcessCmdKey(ByRef msg As
System.Windows.Forms.Message, ByVal keyData As System.Windows.Forms.Keys) As
Boolean

"Agnes" <ag***@dynamictech.com.hk> ¦b¶l¥ó
news:uz**************@TK2MSFTNGP12.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 ProcessKeyPreview(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
16255
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...
0
3181
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...
4
1918
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...
1
3214
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...
1
1671
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...
9
3793
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...
3
3056
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...
4
10466
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...
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...
2
5541
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...
0
7094
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7123
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,...
1
6839
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...
1
4863
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4559
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...
0
3070
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1378
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 ...
1
598
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
259
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...

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.