【发布时间】:2010-05-26 19:11:29
【问题描述】:
如何在 WPF 中使用 WIndows 表单?
在我的 WPF 程序中,我创建了一个 Windows 窗体类。 在这个表单中,我放置了一个 OK 按钮,然后我进入按钮的属性并将 DialogResult 设置为 OK。 现在,我从 MainWindow.xaml.cs 调用这个对话框(窗口窗体):
DialogResult dres;
dres = form.ShowDialog();
if (dres != DialogResult.OK) return;
编译器在抱怨:
Error 3 'System.Nullable<bool>' does not contain a definition for 'OK' and no extension method 'OK'
accepting a first argument of type 'System.Nullable<bool>' could be found (are you missing a using directive
or an assembly reference?)
【问题讨论】: