HSmartWindowControl 之 鼠标放大缩小图像

 

this.hSmartWindowControl1.MouseWheel += new System.Windows.Forms.MouseEventHandler(this.my_MouseWheel);

 

 

private void my_MouseWheel(object sender, MouseEventArgs e)
{
HSmartWindowControl wind = sender as HSmartWindowControl;
if (wind == null)
{
return;
}
System.Drawing.Point pt = this.Location;
int leftBorder = wind.Location.X;
int rightBorder = wind.Location.X + wind.Size.Width;
int topBorder = wind.Location.Y;
int bottomBorder = wind.Location.Y + wind.Size.Height;
if (e.X < leftBorder && e.X < rightBorder && e.Y > topBorder && e.Y < bottomBorder)
{
MouseEventArgs newe = new MouseEventArgs(e.Button, e.Clicks,
e.X - pt.X, e.Y - pt.Y, e.Delta);
wind.HSmartWindowControl_MouseWheel(sender, newe);
}
}

posted @ 2021-11-22 15:49  DevinXiong  阅读(1028)  评论(0)    收藏  举报