如何在负坐标中移动鼠标 [英] How I Can To Move Mouse In Negative Coordinates
问题描述
我有这个代码
[DllImport(" user32.dll")]
static extern void mouse_event(int dwFlags, int dx,int dy,int dwData,int dwExtraInfo);
private const int MOUSEEVENTF_MOVE = 0x0001;
private const int MOUSEEVENTF_LEFTDOWN = 0x0002;
private const int MOUSEEVENTF_LEFTUP = 0x0004;
private const int MOUSEEVENTF_RIGHTDOWN = 0x0008;
private const int MOUSEEVENTF_RIGHTUP = 0x0010;
private const int MOUSEEVENTF_MIDDLEDOWN = 0x0020;
private const int MOUSEEVENTF_MIDDLEUP = 0x0040;
private const int MOUSEEVENTF_ABSOLUTE = 0x8000;
private void Move()
{
PointConverter pc = new PointConverter();
Point pt = new Point();
pt =(Point)pc.ConvertFromString( - 100,10);
Cursor.Position = pt;
}
如何将光标移动到negativa坐标?如果使用此代码光标位置为0,10 ...可以将光标移动到负位置吗?我如何将光标移动到negativa位置或模拟我的表单中的左键单击(webbrowser)
I have this code
[DllImport("user32.dll")]
static extern void mouse_event(int dwFlags, int dx, int dy, int dwData, int dwExtraInfo);
private const int MOUSEEVENTF_MOVE = 0x0001;
private const int MOUSEEVENTF_LEFTDOWN = 0x0002;
private const int MOUSEEVENTF_LEFTUP = 0x0004;
private const int MOUSEEVENTF_RIGHTDOWN = 0x0008;
private const int MOUSEEVENTF_RIGHTUP = 0x0010;
private const int MOUSEEVENTF_MIDDLEDOWN = 0x0020;
private const int MOUSEEVENTF_MIDDLEUP = 0x0040;
private const int MOUSEEVENTF_ABSOLUTE = 0x8000;
private void Move()
{
PointConverter pc = new PointConverter();
Point pt = new Point();
pt = (Point)pc.ConvertFromString("-100, 10");
Cursor.Position = pt;
}
How i can move cursor in negativa coordinates ? If use this code cursor position is 0, 10... It's possible to move cursor in negative position ? How i can move cursor in negativa position or simulate left click in my form (webbrowser)
推荐答案
没有这种称为负坐标的东西。
屏幕左上角对应原点(0,0)。
Ur屏幕可以被认为是图形系统的第四象限,只是x和y具有正值。
这个 [ ^ ]将为您提供更多详细信息。
There is no such thing called negative co-ordinates.
top left corner of your screen corresponds to origin(0,0).
Ur screen can b considered to be in 4th quadrant in a graph system except that x and y have positive values.
this[^] will give you more details.
这篇关于如何在负坐标中移动鼠标的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!