Send a user defined message/event to form controls

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
 
B

Bob Powell [MVP]

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top