喜的CP,
0; 我想创建屏幕/虚拟键盘1,我想在WPF做......我已经craeted的我的布局等,和我设法让我的屏幕上的键盘工作......我的问题是,当我它不是用鼠标来点击和拖动我的虚拟键盘......刚拖后,我松开鼠标点击......有没有办法,我可以清理这个问题,以同样的方式,MS商船工程?{BR }
注:
后来,我将使用触摸屏这个项目......所以我并不需要使用鼠标点击事件......
这里是我的示例代码,
[DllImport("user32.dll")]
public static extern int SetWindowLong(IntPtr hWnd, int nIndex,
IntPtr dwNewLong);
[DllImport("user32.dll", SetLastError = true)]
public static extern UInt32 GetWindowLong(IntPtr hWnd, int nIndex);
public Window1()
{
InitializeComponent();
this.Topmost = true;
}
private void Window_Loaded(object sender, RoutedEventArgs e)
{
IntPtr HWND = new WindowInteropHelper(this).Handle;
const int GWL_EXSTYLE = (-20);
GetWindowLong(HWND, GWL_EXSTYLE);
SetWindowLong(HWND, GWL_EXSTYLE, (IntPtr)(0x8000000));
}
private void AllButton_Click(object sender, RoutedEventArgs e)
{
String tempstring = "";
try
{
e.Handled = true;
tempstring = ((Button)sender).CommandParameter.ToString();
System.Windows.Forms.SendKeys.SendWait(tempstring);
}
catch (Exception ex)
{
System.Windows.Forms.MessageBox.Show(ex.ToString());
}
}