Click here to Skip to main content
15,889,877 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am building a designer application using IDesignerhost.
I have to draw shapes (line, rectangle, polyline) in the designer.
For that I need to get mouse events. Mouse events are not triggered in Idesignerhost.

Can any one please help me?
Posted

The code I have is in VB, but the solution is found in the designer's GetHitTest method. During design time, this method intercepts mouse events; if it returns True it will raise the corresponding mouse event in the designed control's code; otherwise it will return False. I believe that GetHitTest returns False by default, so unless you override it your control will not process mouse events at design time.

Do an Internet search for GetHitTest and you will find more than enough examples to get you started.
 
Share this answer
 
Hi Gregory.Gadow,

Thanks for your reply.

I am using the microsoft sample of designerhost provided in this link
http://support.microsoft.com/kb/813808[^


I am having designerhost as a control not as control designer.
There is no abstract method GetHitTest to override.

Thank you,
Gangarani Rajendran
 
Share this answer
 

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