0
我想以編程方式在usercontrol中選擇一個控件時,從usercontrol向其創建者發送鼠標點擊。在.net中發送鼠標點擊消息
我曾嘗試:
private const int MOUSEEVENTF_LEFTDOWN = 0x02;
private const int MOUSEEVENTF_LEFTUP = 0x04;
[DllImport("user32.dll")]
private static extern void mouse_event(
UInt32 dwFlags, // motion and click options
UInt32 dx, // horizontal position or change
UInt32 dy, // vertical position or change
UInt32 dwData, // wheel movement
IntPtr dwExtraInfo // application-defined information
);
mouse_event(MOUSEEVENTF_LEFTDOWN, 0, 0, 0, new System.IntPtr());
mouse_event(MOUSEEVENTF_LEFTUP, 0, 0, 0, new System.IntPtr());
但我沒有在父recieving事件的任何成功。
也許還有另一種鼠標點擊的方式嗎?
感謝