110,534
社区成员
发帖
与我相关
我的任务
分享
public ChildWindow cw;
private void TextBlock_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
{
WindowInteropHelper Parent = new System.Windows.Interop.WindowInteropHelper(this);
this.cw = new ChildWindow();
cw.ShowDialog();
WindowInteropHelper Child = new System.Windows.Interop.WindowInteropHelper(cw);
Win32Native.SetParent(Child.Handle,Parent.Handle);
MessageBox.Show(cw.Parent.ToString());