467,075 Members | 1,049 Online
Bytes | Developer Community
Ask Question

Home New Posts Topics Members FAQ

Post your question to a community of 467,075 developers. It's quick & easy.

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
  • viewed: 1170
Share:
1 Reply
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 discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

4 posts views Thread by NutJob@gmx.net | last post: by
3 posts views Thread by bardo | last post: by
4 posts views Thread by The Alchemist | last post: by
7 posts views Thread by Girish | last post: by
3 posts views Thread by Carmen de Lara | last post: by
reply views Thread by Andrus | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.