光标位置在特定点手动停止 [英] Cursor Position Stop Manually at Specific Point

查看:92
本文介绍了光标位置在特定点手动停止的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,只想询问是否可以停止或限制光标在特定位置的位置。我想停止在特定点移动光标。谢谢大家

Hi Guys, just want to ask if it is possible to stop or to limit the cursor position at specific place. I want to stop moving my cursor at specific point. Thanks Guys

推荐答案

嗨。试试这个方法:

1-使用System.Runtime.InteropServices添加;

2-当你改变光标位置时处理鼠标事件

3-创建一个If块,你的条件必须是光标位置。

4 - 当光标靠近你最喜欢的区域时,请调用以下方法:

Hi. try this method:
1- add using System.Runtime.InteropServices;
2- handle event of Mouse when you change the cursor position
3- create a If block and your condition must be cursor position.
4-when cursor is near to your favorite area then call following method:
[DllImport("user32.dll")]
        private static extern bool SetCursorPos(int xCoordinate, int yCoordinate);



xCoordinate和yCoordinate必须是有限区域内的任何一点。

i希望这对你有帮助。

祝你好运


xCoordinate and yCoordinate must be any point, out of limited area.
i hope this help you.
good luck


这篇关于光标位置在特定点手动停止的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆