Tag: cursor position

文本框SelectionStart,SelectionEnd和Caret(光标)位置

这可能非常简单。 我在WinForm上有一个文本框,Text =“ABCDEFGH”。 我需要选择“BCD”并将I-Beam(光标,插入符号,闪烁’|’)放在’A’和’B’之间。 设置SelectionStart = 1和SelectionLenght = 3不起作用,我无法弄明白。

C# – 光标位置(全屏)

请帮帮我! :)我的程序应该每隔~50毫秒获得光标位置(所有屏幕)并在文本框中写入 。 怎么做的? 例: private void Form1_MouseMove(object sender, MouseEventArgs e) { textBox1.Text = eXToString(); textBox2.Text = eYToString(); } 但我们只在窗口得到位置 它真的吗?

在MSPaint中模拟鼠标单击

我有一个控制台应用程序应该在MSPaint中绘制一个随机图片(鼠标按下 – >让光标随机绘制一些东西 – >鼠标向上。这是我到目前为止(我在Main方法中添加了注释,以便更好地理解我想要的内容)实现): [DllImport(“user32.dll”, CallingConvention = CallingConvention.StdCall)] public static extern void mouse_event(long dwFlags, uint dx, uint dy, long cButtons, long dwExtraInfo); private const int MOUSEEVENTF_LEFTDOWN = 0x201; private const int MOUSEEVENTF_LEFTUP = 0x202; private const uint MK_LBUTTON = 0x0001; public delegate bool EnumWindowsProc(IntPtr hWnd, IntPtr parameter); [DllImport(“user32.dll”, SetLastError = true)] static extern IntPtr […]