473,473 Members | 4,185 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

i would like to write my event that will react on specific keys in my custom DataGrid (WinForms)...

i would like to write my event that will react on specific keys in my custom DataGrid (WinForms)...
please help to do this.
so far i have this custom grid...
and i create it in main object
namespace CustomGrid

{

public delegate void ArrowKeyPressed(object sender, System.Windows.Forms.KeyEventArgs e);

public class DataGridSE : System.Windows.Forms.DataGrid

{

protected override bool ProcessCmdKey(ref Message msg, Keys keyData)

{

if (keyData == Keys.Up || keyData == Keys.Down)

{

MessageBox.Show("Yes");

return true; //EVENT HANDLED

}

else

{

return base.ProcessCmdKey(ref msg, keyData);

}

}
}

}

Nov 17 '05 #1
1 1401
have you had a look at DataGridTextBox.ProcessKeyMessage method for
datagrids:

http://msdn.microsoft.com/library/de...ssageTopic.asp

HTH

Ollie Riches

"Serdge Kooleman" <Su***@web.de> wrote in message
news:ez**************@TK2MSFTNGP14.phx.gbl...
i would like to write my event that will react on specific keys in my custom
DataGrid (WinForms)...
please help to do this.
so far i have this custom grid...
and i create it in main object
namespace CustomGrid
{
public delegate void ArrowKeyPressed(object sender,
System.Windows.Forms.KeyEventArgs e);
public class DataGridSE : System.Windows.Forms.DataGrid
{
protected override bool ProcessCmdKey(ref Message msg, Keys keyData)
{
if (keyData == Keys.Up || keyData == Keys.Down)
{
MessageBox.Show("Yes");
return true; //EVENT HANDLED
}
else
{
return base.ProcessCmdKey(ref msg, keyData);
}
}
}
}
Nov 17 '05 #2

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

Similar topics

4
by: NutJob | last post by:
Hello, I'm faced with the following problem: I have a (secondary) thread that monitors a socket for incoming message traffic using the select.select() function. Besides that I also have the...
3
by: bardo | last post by:
I have a Datagrid that is inside a panel. I want to use the keyDown event to reconize the arrow keys. But I have no luck at all. The problem is that the keydown event won't fire at all, unless I...
4
by: The Alchemist | last post by:
I am having a problem with a dynamically-generated Datagrid. It is important to point out that this problem does not exist with a design-time created Datagrid, but only with a dynamically generated...
7
by: Girish | last post by:
OK.. phew. Playing with data grids for the past few days has been fun and a huge learning experience.. My problem. I have a requirement to display a gird with a gird. Within the embedded grid,...
4
by: EvelynAnd Ethan | last post by:
Hi, ItemCommand event not firing from a dynamic user control ,WHERE A DATAGRID HAS BUTTON,when i click on the linkbutton first time the itemcommand event doesnt fire,second time event fires up ...
3
by: Carmen de Lara | last post by:
hello to all, I found in Internet the following code that is very usefull to me. The code detects any character that is entered to datagrid, I am interested in the control key F2 but I don't know...
5
by: Lars Netzel | last post by:
Hey! I have tried...(in a datagrid) e.KeyDate.Return and e.KeyDate.TAB end e.KeyDate.Enter
2
by: Lars Netzel | last post by:
Hi What events are there to do things in when I am on a row in a datagrid (bound from a dataset) and press Delete key... There's no Delete Event on the drig and I can't figure out if there are...
0
by: Andrus | last post by:
MDI WinForms 2 application. I need that Ctrl+F1 cycles through windows like Ctrl+Tab and Ctrl+Tab is redefined. I overrided MDI child form OnKeypress method but Ctrl+F1 press is ignored. For...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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...
0
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,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
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
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
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.