Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Ruler can't handle any mouse event (Read 1494 times)
Kyle Chen
Full Member
***
Offline


I Love MindFusion!

Posts: 104
Joined: Nov 29th, 2012
Ruler can't handle any mouse event
Nov 29th, 2012 at 10:52pm
Print Post  
I'm using the latest version of winform diagram. I'd like to do something when double-click on ruler. However seems most of events are ignored?
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Ruler can't handle any mouse event
Reply #1 - Nov 30th, 2012 at 6:06am
Print Post  
Hi,

Ruler is a composite control and you will have to attach handlers to its child controls to detect double click on the ruler scales:

Code
Select All
HandleDoubleClick(ruler);

void HandleDoubleClick(Control parent)
{
	if (parent is DiagramView || parent is ScrollBar)
		return;
	parent.DoubleClick += OnRulerDoubleClick;
	foreach (Control child in parent.Controls)
		HandleDoubleClick(child);
}

private void OnRulerDoubleClick(object sender, EventArgs e)
{
	MessageBox.Show("ruler double clicked");
} 



I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
Kyle Chen
Full Member
***
Offline


I Love MindFusion!

Posts: 104
Joined: Nov 29th, 2012
Re: Ruler can't handle any mouse event
Reply #2 - Nov 30th, 2012 at 3:07pm
Print Post  
That works perfect! Thank you  Wink
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint