Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic MouseWheel Doesn't work?? (Read 2637 times)
Erison Liang
Guest


MouseWheel Doesn't work??
Dec 8th, 2005 at 12:01pm
Print Post  
How can I enable it that using mouse wheel to scroll large flowchart diagram?

- Erison
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: MouseWheel Doesn't work??
Reply #1 - Dec 8th, 2005 at 12:25pm
Print Post  
You can use the mouse wheel by handling the MouseWheel event and changing ScrollX/Y from there. This event is inherited from the Control class, but some reason it doesn't appear in the VS event list; you must add a handler for it manually.

private void Form1_Load(object sender, System.EventArgs e)
{
  fc.MouseWheel += new   
    MouseEventHandler(fc_MouseWheel);
}

void fc_MouseWheel(object sender, MouseEventArgs args)
{
  FlowChart fcSender = sender as FlowChart;

  float newScrollY = fcSender.ScrollY - args.Delta / 50;
  if (newScrollY > fcSender.DocExtents.Top)
    fcSender.ScrollY = newScrollY;
}

Stoyan
  
Back to top
 
IP Logged
 
Erison Liang
Guest


Re: MouseWheel Doesn't work??
Reply #2 - Dec 9th, 2005 at 1:11am
Print Post  
It works! Thanks to you.

- Erison
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint