Pushing Mouse Events higher up


I have built a custom usercontrol that displays treeview differently. The first level of the treeview is displayed as a button and the lower levels are displayed as seperate treeviews.

Example: Tree A B C
sublevel A : 1 2 3
sublevel B : 1
sublevel 1 : 1a 1b

so if I click on the button with label A I get to see a tree:

if I click on b =>

 1 -

All of that works perfectly. All the labels and treeviews are generated during the code executing depending on the data that has been given to the control. I've created my event

        mainLabel.Tv.NodeMouseDoubleClick += new TreeNodeMouseClickEventHandler(Tv_NodeMouseDoubleClick);

        void Tv_NodeMouseDoubleClick(object sender, TreeNodeMouseClickEventArgs e)
            clickedNodePath = e.Node.FullPath;
            this.RaiseMouseEvent(this, e);

so that when a node is doubleclicked an event is raised so I can get the full path. The only problem is that
RaiseMouseEvent cannot be used. And the whole idea is that my control which contains my extendedlabels fires an event that can be captured by the form that contains the control.

But I don't manage to raise another event. I prefer not to write my own eventhandler since I already have anotherone in my framework that capturs data read events etcetera.
LVL 19
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

"I prefer not to write my own eventhandler"  well then, you are out of luck - the only way to accomplish what you are describing is to have the original event handler, raise a new event, which can the  be handled by the form which is hosting your User Control.  Cascading the events back uup the hosting hierarchy is a fairly common scenario, and there is no other way to accomplish it, other than passing the events up the hosting chain.

Form1 hosts control1 which in turn hosts control1a - control1a raises an event which is handled by control1, which in turn raises a new event, which is then handled by Form1.


Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
MsShadowAuthor Commented:
Appearantly you cannot just give an assist accept so i am giving you a full accept. Wrote my own handler.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.