wpf 在 popup 中打字,输入法被遮挡问题处理。
需要将焦点强制赋值到popup的child上面
FocusElement(myPopup.Child)
public static void FocusElement(UIElement ui) { SetFocus(((System.Windows.Interop.HwndSource)PresentationSource.FromVisual(ui)).Handle); } [System.Runtime.InteropServices.DllImport("user32")] public static extern IntPtr SetFocus(IntPtr hWnd);

浙公网安备 33010602011771号