现在我有一个FORM表单,上面有若干个按钮,假定其中有3个按钮,分别是
Name为btn1,Text为按钮1
Name为btn2,Text为按钮2
Name为btn3,Text为按钮3
我想通过一个方法:
在鼠标移动到“按钮1”能够弹出消息框提示“btn1”
在鼠标移动到“按钮2”能够弹出消息框提示“btn2”
在鼠标移动到“按钮3”能够弹出消息框提示“btn3”
Name为btn1,Text为按钮1
Name为btn2,Text为按钮2
Name为btn3,Text为按钮3
我想通过一个方法:
在鼠标移动到“按钮1”能够弹出消息框提示“btn1”
在鼠标移动到“按钮2”能够弹出消息框提示“btn2”
在鼠标移动到“按钮3”能够弹出消息框提示“btn3”
得到按钮的坐标,一个判断,当鼠标移动到相应坐标的时候做操作
<input id = "btn2" type = "button" onmousemove = "show(this)" text = "按钮2" />
<input id = "btn3" type = "button" onmousemove = "show(this)" text = "按钮3" />
<script>
function show(o)
{
alert(o.id);
}
</script>
这个事WEB的,不是我想要的,两者貌似不能互用吧
获得鼠标坐标,控件坐标,鼠标坐标=控件坐标时弹出你不做点击的话一般就只能通过坐标来判断了吧,
我才疏学浅就能想到这个了
btn1.mouseEnter+=mouseenter;
btn2.mouseEnter+=mouseenter;
btn3.mouseEnter+=mouseenter;void mouseenter(object sender,mouseeeventarg e)
{
MessageBox.Show(((button)sender).Text);
}
直接在那个下面写就行了