Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
标题中的问题,如何在父级中心打开表单
Window win = new MyWPFWindow(); win.... ???
Window win = new MyWPFWindow(); win.WindowStartupLocation = WindowStartupLocation.CenterOwner; // the "parent" needs to be another window; most likely, you can just use "this" win.Owner = parent; win.Show();
考虑以下创建 XML 文档并显示它的简单代码。
XmlDocument xml = new XmlDocument(); XmlElement root = xml.CreateElement("root"); xml.AppendChild(root); XmlComment comment = xml.CreateComment("Co