C#文字跟随鼠标移动

鼠标右侧会出现文字,会跟随鼠标一起移动。如有回答可行者必有重赏!是在WinForm里做的。... 鼠标右侧会出现文字,会跟随鼠标一起移动。如有回答可行者必有重赏!
是在WinForm里做的。
展开
 我来答
woshijinzijin
2008-05-29 · 超过25用户采纳过TA的回答
知道答主
回答量:118
采纳率:0%
帮助的人:102万
展开全部
脚本说明:<br>
第一步:把如下代码加入<body>区域中<br>
<SCRIPT LANGUAGE="JavaScript"><br>
<!-- Begin<br>
function mover()<br>
{<br>
document.all.x.style.left = event.clientX;<br>
document.all.x.style.top = event.clientY;<br>
document.all.x1.style.top = event.clientX;<br>
document.all.x1.style.left = event.clientY;<br>
document.all.x2.style.top = event.clientX;<br>
document.all.x2.style.right = event.clientY;<br>
document.all.x3.style.right = event.clientX;<br>
document.all.x3.style.top = event.clientY;<br>
document.all.x4.style.bottom= event.clientX;<br>
document.all.x4.style.right = event.clientY;<br>
document.all.x5.style.bottom= event.clientX;<br>
document.all.x5.style.left = event.clientY;<br>
document.all.x6.style.left= event.clientX;<br>
document.all.x6.style.bottom = event.clientY;<br>
document.all.x7.style.right= event.clientX;<br>
document.all.x7.style.bottom = event.clientY;<br>
}<br>
// End --><br>
</script><br>
<DIV ID = "x", STYLE = "position: absolute; filter: glow(strength = 3, color = red)"> Merry christmas </DIV><br>
<DIV ID = "x1", STYLE = "position: absolute; filter: glow(strength = 3, color = blue)"> Happy new year </DIV><br>
<DIV ID = "x2", STYLE = "position: absolute; filter: glow(strength = 3, color = blue)"> Merry christmas </DIV><br>
<DIV ID = "x3", STYLE = "position: absolute; filter: glow(strength = 3, color = red)"> Happy new year </DIV><br>
<DIV ID = "x4", STYLE = "position: absolute; filter: glow(strength = 3, color = green)"> Merry christmas </DIV><br>
<DIV ID = "x5", STYLE = "position: absolute; filter: glow(strength = 3, color = green)"> Happy new year </DIV><br>
<DIV ID = "x6", STYLE = "position: absolute; filter: glow(strength = 3, color = purple)"> Merry christmas </DIV><br>
<DIV ID = "x7", STYLE = "position: absolute; filter: glow(strength = 3, color = purple)"> Happy new year </DIV><br>
<br>
<br>
第二步:把<body>中的内容改为:<br>
<body ONMOUSEMOVE="mover()"><br>
推荐律师服务: 若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询

为你推荐:

下载百度知道APP,抢鲜体验
使用百度知道APP,立即抢鲜体验。你的手机镜头里或许有别人想知道的答案。
扫描二维码下载
×

类别

我们会通过消息、邮箱等方式尽快将举报结果通知您。

说明

0/200

提交
取消

辅 助

模 式