How do I work with WIndows Forms in WPF?
In my WPF program I created a Windows Form class.
In this Form, I placed an OK button and I went into the properties of the button and set the DialogResult to OK.
Now, I am calling this Dialog (Window Form) from the MainWindow.xaml.cs:
DialogResult dres; dres =
form.ShowDialog(); if (dres != DialogResult.OK)
return;
|
The compiler is complaining:
Error 3 'System.Nullable' does not contain a definition
for 'OK' and no extension method 'OK' accepting a first argument of type
'System.Nullable' could be found (are you missing a using directive
or an assembly reference?)
|
PJ MartinsPosted May 26, 2010, 3:22 PM
Alternatively try
if (form.ShowDialog() != DialogResult.OK) return;
William ThompsonPosted May 26, 2010, 3:38 PM
This worked: DialogResult dres;
dres = form.ShowDialog();
if (dres != System.Windows.Forms.DialogResult.OK) return;