This entire thread is dealing with the MessageBox class which is part of WPF.
If you are using Windows Forms then there is a different MessageBox class which is within the System.Windows.Forms namespace that is close to but not identical to the one shown above for WPF.
Please see the MSDN entry here:
In Windows Forms the equivalent would be something like the following:
(namespace System.Windows.Forms should be included in the namespace list by default)
evaluate type MessageBox::Show(
"Mein Text",
"Kopfzeile",
type MessageBoxButtons::YesNo
type MessageBoxIcon::Question
type MessageBoxDefaultButton::Button1
type MessageBoxOptions::RightAlign)
when type DialogResult::Yes
continue
when type DialogResult::No
continue
end-evaluate.