Click here to Skip to main content
16,017,922 members
Home / Discussions / C#
   

C#

 
GeneralRe: real challenge! How to implicitly override a Win form method Pin
Tom Larsen18-May-05 4:48
Tom Larsen18-May-05 4:48 
GeneralRe: real challenge! How to implicitly override a Win form method Pin
jinzhecheng18-May-05 5:04
jinzhecheng18-May-05 5:04 
GeneralRe: real challenge! How to implicitly override a Win form method Pin
Marc Clifton18-May-05 5:41
mvaMarc Clifton18-May-05 5:41 
GeneralRe: real challenge! How to implicitly override a Win form method Pin
S. Senthil Kumar18-May-05 5:48
S. Senthil Kumar18-May-05 5:48 
GeneralRe: real challenge! How to implicitly override a Win form method Pin
jinzhecheng18-May-05 6:21
jinzhecheng18-May-05 6:21 
GeneralRe: real challenge! How to implicitly override a Win form method Pin
Marc Clifton18-May-05 6:53
mvaMarc Clifton18-May-05 6:53 
GeneralRe: real challenge! How to implicitly override a Win form method Pin
18-May-05 6:59
suss18-May-05 6:59 
GeneralRe: real challenge! How to implicitly override a Win form method Pin
DavidNohejl18-May-05 6:55
DavidNohejl18-May-05 6:55 
But Marc is raising an event there...
class MyForm : Form
{
  public delegate bool WndProcOverrideDlgt(ref Message m);
  public event WndProcOverrideDlgt WndProcOverride;
  protected override void WndProc(ref Message m)
  {
    bool handled=false;
    if (WndProcOverride != null)
    {
      handled=WndProcOverride(m);
    }
    if (!handled)
    {
      // do your usual stuff.
    }
  }
}

So
Form a = new MyForm();
a.WndProcOverride += new WndProcOverrideDlgt(WndProc_Handler);
...
bool WndProc_Handler(ref Message m)
{
 // do client stuff here
}


p.s If S. Senthil Kumar is right and you can't have bool delegate (I dunno and lazy to look up) you can do it like public delegate void WndProcOverrideDlgt(ref Message m, ref bool handled);

At least I hope so Smile | :)

David

Never forget: "Stay kul and happy" (I.A.)

David's thoughts / dnhsoftware.org / MyHTMLTidy
Generaldeleting particular node element from xml file through LOOP Pin
ksanju100018-May-05 4:13
ksanju100018-May-05 4:13 
QuestionAVISaveOptions Invisible Font? Pin
Member 190300618-May-05 4:07
Member 190300618-May-05 4:07 
GeneralSelecting row Index of datagrid Pin
Ashishhere18-May-05 3:34
Ashishhere18-May-05 3:34 
GeneralRe: Selecting row Index of datagrid Pin
Marc Clifton18-May-05 4:17
mvaMarc Clifton18-May-05 4:17 
GeneralComboBox - remove focus Pin
NortonC18-May-05 2:05
NortonC18-May-05 2:05 
GeneralRe: ComboBox - remove focus Pin
Marc Clifton18-May-05 2:12
mvaMarc Clifton18-May-05 2:12 
GeneralRe: ComboBox - remove focus Pin
NortonC18-May-05 2:19
NortonC18-May-05 2:19 
GeneralProject Type in VS 2005 Pin
rathishps18-May-05 1:05
rathishps18-May-05 1:05 
GeneralGet High Byte of Int16 Pin
zuschauer198018-May-05 0:32
zuschauer198018-May-05 0:32 
GeneralRe: Get High Byte of Int16 Pin
Marc Clifton18-May-05 1:11
mvaMarc Clifton18-May-05 1:11 
GeneralRe: Get High Byte of Int16 Pin
S. Senthil Kumar18-May-05 1:21
S. Senthil Kumar18-May-05 1:21 
GeneralRe: Get High Byte of Int16 Pin
Mike Dimmick18-May-05 1:42
Mike Dimmick18-May-05 1:42 
Generaltwo's complement Pin
zuschauer198018-May-05 1:46
zuschauer198018-May-05 1:46 
GeneralRe: two's complement Pin
Sebastian Schneider18-May-05 3:50
Sebastian Schneider18-May-05 3:50 
GeneralRe: two's complement Pin
zuschauer198018-May-05 22:49
zuschauer198018-May-05 22:49 
GeneralCheckedListBoxes Pin
17-May-05 23:19
suss17-May-05 23:19 
GeneralRe: CheckedListBoxes Pin
Robert Rohde18-May-05 0:34
Robert Rohde18-May-05 0:34 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.