Click here to Skip to main content
15,889,462 members
Please Sign up or sign in to vote.
2.00/5 (1 vote)
I'm making a user control that acts as an icon.

I would like the control to have the same basic behavior regardless of what child control is being triggered.
For example. If a user clicks on a child control -- any child control-- i want to raise the parent controls Clicked event.

is there a was of doing this without manually raising the events?


if the mouse hovers anywhere over the control or any of its children, i want the same tool tip to activate. Must i configure each child control with this behavior, or is there a simpler solution?
Posted
Updated 3-Nov-13 9:47am
v2
Comments
Sergey Alexandrovich Kryukov 3-Nov-13 15:19pm    
So, VB or VB.NET? Is it System.Windows.Forms, WPF or something else?
You always need to tag your UI library/framework or application type when UI is concerned.
Yes, there is a simpler solution, and this is not a re-routing (why?!). This is previewing events on the form/window. You should understand that events are always reach the form/window, you just need to handle them on this level.
—SA
Mr.TMG 3-Nov-13 15:58pm    
Fixed the tag to reflect vb.net.
On my userControl, I basically want to raise events like Me.DoubleClicked as the usercontrol which houses the objects (Like textbox) that are actually being double clicked.

currently, what i'm doing is this
Sub textBox_DoubleClicked(Sender,E as eventargs)Handles TextBox.doubleClicked
Me.Icon_DoubleClick(Me, E)
end sub
Sergey Alexandrovich Kryukov 3-Nov-13 16:37pm    
Which "TextBox"? Do you think there is one? Full type name, please.
—SA

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900