Raising event without definig a function for it

  • Thread starter Thread starter René Meinecke
  • Start date Start date
R

René Meinecke

hi there,

i want to raise an event, for example a DoubleClick-Event of a DataGrid, but
i do not want to call a function
which is event handler.

Right now i do it like this:
void this_KeyDown(object sender, KeyEventArgs ke)

{

if (ke.KeyCode == Keys.Space)

this_DoubleClick(sender, null);

} // this_KeyDown


But in my form window, which holds the DataGrid, i did not get any calls
depending on the DoubleClick,
so i can´t do anything on that moment.

Plz help!

René
 
Hi,

If you want to trigger the DoubleClick event of a DataGrid from within a
derived class, you should call OnDoubleClick( new EventArgs() ); This
should fire all registered events.

HTH,
Greetings
 
Hi,

thanks a lot, that was it!

but i can´t believe, that there is no hint in the help of Visual Studio or
on any of the webpages to it.
so if anyone from Microsoft reads this, update your ****ing help and tell
the people something
that is working.

so again, thx a lot and peace
René
 
Back
Top