Send a user defined message/event to form controls

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

HI,

it's possible to "send" a custom message/event to a form, so the
controls that "implements" an handler to this event process it?

As an example,
I definied a custom list view, that after an item select raise a custom event
"UpdateText"

In a form i have
- custom button control
- custom label control
- custom textbox control

that should update their text, with the one selected in LIstView.

Thanks in advance
Best Regards
Massimo
 
Windows Forms controls send and receive messages in the same way as win32
code. You can use p/invoke to import the SendMessage or PostMessage API's
and you can override the WndProc in controls to handle the custom messages.

--
Bob Powell [MVP]
Visual C#, System.Drawing

Find great Windows Forms articles in Windows Forms Tips and Tricks
http://www.bobpowell.net/tipstricks.htm

Answer those GDI+ questions with the GDI+ FAQ
http://www.bobpowell.net/faqmain.htm

All new articles provide code in C# and VB.NET.
Subscribe to the RSS feeds provided and never miss a new article.
 
Back
Top