if(secureRect.Contains(e.X,e.Y)//矩形区域包含鼠标
{
this.Cursor = Cursors.Hand;
if(单击鼠标)
{
Form2 f=new form2();
f.ShowDialog;
this.Closed();
}
请问里面那个“单击鼠标”怎么判断???
我的意思就是这,如果你有好的方法也可以留下,急用!!!谢谢
{
this.Cursor = Cursors.Hand;
if(单击鼠标)
{
Form2 f=new form2();
f.ShowDialog;
this.Closed();
}
请问里面那个“单击鼠标”怎么判断???
我的意思就是这,如果你有好的方法也可以留下,急用!!!谢谢
this.Cursor = Cursors.Hand; //rect 属性里设置private void Rect_MouseClick(object sender, MouseEventArgs e)
{ if (e.Button == MouseButtons.Left)
{
Form2 f=new form2();
f.ShowDialog();
//this.Closed();
}}
Form2 f=new form2();
f.ShowDialog;
this.Closed();
{
public Form1()
{
InitializeComponent();
} bool isInRect = false;
protected override void OnMouseMove(MouseEventArgs e)
{
base.OnMouseMove(e);
if (e.X > 3 && e.X < 20 && e.Y > 3 && e.Y < 20)
{
Cursor = Cursors.Hand;
isInRect = true;
}
else
{
isInRect = false;
Cursor = Cursors.Default;
}
}
protected override void OnMouseClick(MouseEventArgs e)
{
base.OnMouseClick(e);
if (isInRect && e.Button == MouseButtons.Left)
{
MessageBox.Show("click in rect.");
}
}
}
if (secureRect.Contains(e.X, e.Y))
{
this.Cursor = Cursors.Hand;
if (e.Button == MouseButtons.Left)
{ button1.Text = "123456";
}
}
else
{
this.Cursor = Cursors.Default;
}
但在矩形区域时,
总是单击左键多次才会出现button1.Text = "123456";
很少有单击一次成功的,这是为什么呀???牛人赶紧帮忙解决,完了结贴了,呵呵@@@