c#窗体mousewheel事件,这么写为什么滚动鼠标没反应呢?
privatevoiddrawform_MouseWheel(objectsender,MouseEventArgse){Bitmapb=(Bitmap)this.Bac...
private void drawform_MouseWheel(object sender, MouseEventArgs e)
{
Bitmap b = (Bitmap)this.BackgroundImage;
MessageBox.Show("滚动事件已被捕捉");
if (e.Delta < 0)//向下滚动
{
b = new Bitmap(b, (int)(1.2 * b.Width), (int)1.2 * b.Height);
}
else//向上滚动
{
b = new Bitmap(b, (int)0.8 * b.Width, (int)0.8 * b.Height);
}
} 展开
{
Bitmap b = (Bitmap)this.BackgroundImage;
MessageBox.Show("滚动事件已被捕捉");
if (e.Delta < 0)//向下滚动
{
b = new Bitmap(b, (int)(1.2 * b.Width), (int)1.2 * b.Height);
}
else//向上滚动
{
b = new Bitmap(b, (int)0.8 * b.Width, (int)0.8 * b.Height);
}
} 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询