C#获取当前鼠标坐标
我想用C#获取当前鼠标的屏幕坐标,其值显示在lable1.textprivateThreadt;protectedvoidwd(){while(true){label1....
我想用C#获取当前鼠标的屏幕坐标,其值显示在lable1.text
private Thread t;
protected void wd()
{
while (true)
{
label1.Text = MousePosition.X.ToString() + "," + MousePosition.Y.ToString();
}
}
private void button1_Click(object sender, EventArgs e)
{
t = new Thread(wd);
t.Start();
}
这样确实可行,但我发现太占cpu资源了,占了30%多。有没有好一点的办法? 展开
private Thread t;
protected void wd()
{
while (true)
{
label1.Text = MousePosition.X.ToString() + "," + MousePosition.Y.ToString();
}
}
private void button1_Click(object sender, EventArgs e)
{
t = new Thread(wd);
t.Start();
}
这样确实可行,但我发现太占cpu资源了,占了30%多。有没有好一点的办法? 展开
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询