I've got a WinForms question, that hopefully isn't too twisty!

I'm working with a [Splitter] object, and what I'm wanting to do is maintina
good control over it's visual appearance. I'm settings it's
BackgroundImage, but what I also want to do is insert an Image within it
(which is a visual representation of something to grab - like the grabber
image at the bottom-right of a form). For scaling and positional reasons I
can't have the grabber icon as part of the actual BG image.

Here's the problem: I can insert the image into the [Splitter], and position
it just fine. But when the user clicks on it, the [Splitter] won't move,
because it is the image recieving the click action, not the containing
[Splitter].

Is there some way I can bubble the click event up to the containing
[Splitter], so that it thinks it has been clicked, rather that it's child
Image control?

Thanks everyone.
===
Phil
(Auckland | Aotearoa)

RE: Image within Splitter - Bubbling Click Event by jchREMOVE

jchREMOVE
Wed Jun 02 03:16:06 CDT 2004

When bubbling events in WinForms you have to do some work yourself to make it work. Check out the following link

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpguide/html/cpconeventbubblingcontrolsample.as

System.Windows.Forms.Control does not have a RaiseBubbleEvent method such as System.Web.UI.Control

Regards, Jakob.

RE: Image within Splitter - Bubbling Click Event by v-yiy

v-yiy
Wed Jun 02 03:50:58 CDT 2004

Hi Phil,

Just as Jakob said, Winform does not use the event bubbling mechanism,
generally, we may handle the splitter.paint event and draw the grab icon
onto the splitter, so that there would be only one control. You may read
the Control.Paint event for more information:
<Control.Paint event>
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/
frlrfsystemwindowsformscontrolclasspainttopic.asp

If you have any questions on this issue, please feel free to reply this
thread.

Good luck!

Best regards,

Ying-Shen Yu [MSFT]
Microsoft Community Support
Get Secure! - www.microsoft.com/security

This posting is provided "AS IS" with no warranties and confers no rights.
This mail should not be replied directly, please remove the word "online"
before sending mail.


Re: Image within Splitter - Bubbling Click Event by Phil

Phil
Wed Jun 02 16:13:52 CDT 2004

Thanks Ying-Shen and Jakob. That gives me a handle on what to do here.

Cheers,
===
Phil