Skip to main content

Hi!

I have a WPF MessageBox like this:

invoke type System.Windows.MessageBox::Show(

"Mein Text",

"Kopfzeile",

type System.Windows.MessageBoxButton::YesNo

type System.Windows.MessageBoxImage::Question

type System.Windows.MessageBoxResult::Yes

type System.Windows.MessageBoxOptions::RightAlign

)

How can i ask wich button was pressed?

 


#WPFMessageBox

Hi!

I have a WPF MessageBox like this:

invoke type System.Windows.MessageBox::Show(

"Mein Text",

"Kopfzeile",

type System.Windows.MessageBoxButton::YesNo

type System.Windows.MessageBoxImage::Question

type System.Windows.MessageBoxResult::Yes

type System.Windows.MessageBoxOptions::RightAlign

)

How can i ask wich button was pressed?

 


#WPFMessageBox

capture the return value:

77 msgBoxResult Type System.Windows.MessageBoxResult.

set msgBoxResult  to  type System.Windows.MessageBox::Show(

   "Mein Text", "Kopfzeile",

    type System.Windows.MessageBoxButton::YesNo,

    type System.Windows.MessageBoxImage::Question,

    type System.Windows.MessageBoxResult::Yes

    type System.Windows.MessageBoxOptions::RightAlign)

see msdn.microsoft.com/.../system.windows.messageboxresult.aspx for values


Hi!

I have a WPF MessageBox like this:

invoke type System.Windows.MessageBox::Show(

"Mein Text",

"Kopfzeile",

type System.Windows.MessageBoxButton::YesNo

type System.Windows.MessageBoxImage::Question

type System.Windows.MessageBoxResult::Yes

type System.Windows.MessageBoxOptions::RightAlign

)

How can i ask wich button was pressed?

 


#WPFMessageBox

You could also just test for the result directly in a conditional statement like:

      evaluate type System.Windows.MessageBox::Show(
             "Mein Text",
             "Kopfzeile",
              type System.Windows.MessageBoxButton::YesNo
              type System.Windows.MessageBoxImage::Question
              type System.Windows.MessageBoxResult::Yes
              type System.Windows.MessageBoxOptions::RightAlign)
          when type MessageBoxResult::Yes
               perform yes-processing
            when type MessageBoxResult::No
               perform no-processing
       end-evaluate


Hi!

I have a WPF MessageBox like this:

invoke type System.Windows.MessageBox::Show(

"Mein Text",

"Kopfzeile",

type System.Windows.MessageBoxButton::YesNo

type System.Windows.MessageBoxImage::Question

type System.Windows.MessageBoxResult::Yes

type System.Windows.MessageBoxOptions::RightAlign

)

How can i ask wich button was pressed?

 


#WPFMessageBox

super... the last is what i Need :-)

Many thanks!


Hi!

I have a WPF MessageBox like this:

invoke type System.Windows.MessageBox::Show(

"Mein Text",

"Kopfzeile",

type System.Windows.MessageBoxButton::YesNo

type System.Windows.MessageBoxImage::Question

type System.Windows.MessageBoxResult::Yes

type System.Windows.MessageBoxOptions::RightAlign

)

How can i ask wich button was pressed?

 


#WPFMessageBox

super... the last is what i Need :-)

Many thanks!


Hi!

I have a WPF MessageBox like this:

invoke type System.Windows.MessageBox::Show(

"Mein Text",

"Kopfzeile",

type System.Windows.MessageBoxButton::YesNo

type System.Windows.MessageBoxImage::Question

type System.Windows.MessageBoxResult::Yes

type System.Windows.MessageBoxOptions::RightAlign

)

How can i ask wich button was pressed?

 


#WPFMessageBox

super... the last is what i Need :-)

Many thanks!


Hi!

I have a WPF MessageBox like this:

invoke type System.Windows.MessageBox::Show(

"Mein Text",

"Kopfzeile",

type System.Windows.MessageBoxButton::YesNo

type System.Windows.MessageBoxImage::Question

type System.Windows.MessageBoxResult::Yes

type System.Windows.MessageBoxOptions::RightAlign

)

How can i ask wich button was pressed?

 


#WPFMessageBox

Bernd, in case you didn't know, you can also abbreviate some of the types you're using if you wish to.

You can do this either by adding a $set ILUSING(System.Windows.Forms) in the source code or in the namespaces tab in the project settings.

This would allow you to code:

 evaluate type MessageBox::Show(

            "Mein Text",

            "Kopfzeile",

             type MessageBoxButton::YesNo

             type MessageBoxImage::Question

             type MessageBoxResult::Yes

             type MessageBoxOptions::RightAlign)


Hi!

I have a WPF MessageBox like this:

invoke type System.Windows.MessageBox::Show(

"Mein Text",

"Kopfzeile",

type System.Windows.MessageBoxButton::YesNo

type System.Windows.MessageBoxImage::Question

type System.Windows.MessageBoxResult::Yes

type System.Windows.MessageBoxOptions::RightAlign

)

How can i ask wich button was pressed?

 


#WPFMessageBox

I get errors when I use this. What's missing?

I have the personal version VS2012.

Any help is appreciated.


Hi!

I have a WPF MessageBox like this:

invoke type System.Windows.MessageBox::Show(

"Mein Text",

"Kopfzeile",

type System.Windows.MessageBoxButton::YesNo

type System.Windows.MessageBoxImage::Question

type System.Windows.MessageBoxResult::Yes

type System.Windows.MessageBoxOptions::RightAlign

)

How can i ask wich button was pressed?

 


#WPFMessageBox

What is the error that you are getting?


Hi!

I have a WPF MessageBox like this:

invoke type System.Windows.MessageBox::Show(

"Mein Text",

"Kopfzeile",

type System.Windows.MessageBoxButton::YesNo

type System.Windows.MessageBoxImage::Question

type System.Windows.MessageBoxResult::Yes

type System.Windows.MessageBoxOptions::RightAlign

)

How can i ask wich button was pressed?

 


#WPFMessageBox

I get the red line under type MessageBoxButton::YesNo and the message is Unknown Type.

And yes I copied the code and pasted it in.


Hi!

I have a WPF MessageBox like this:

invoke type System.Windows.MessageBox::Show(

"Mein Text",

"Kopfzeile",

type System.Windows.MessageBoxButton::YesNo

type System.Windows.MessageBoxImage::Question

type System.Windows.MessageBoxResult::Yes

type System.Windows.MessageBoxOptions::RightAlign

)

How can i ask wich button was pressed?

 


#WPFMessageBox

The System.Windows.MessageBoxButton class is in the PresentationFramework.dll assembly which should be added to your project references automatically as part of the template.

Open up the References folder in Solution Explorer. Do you see PresentationFramework listed?

If you are referencing the class MessageBoxButton without the full System.Windows namespace then you need to import the namespace into your project.

You can do this either by checking the box next to System.Windows under Project Properties-->Namespace tab or by adding the directive ilusing"System.Windows" to the top of your source or within your project directives under Properties-->COBOL tab.


Hi!

I have a WPF MessageBox like this:

invoke type System.Windows.MessageBox::Show(

"Mein Text",

"Kopfzeile",

type System.Windows.MessageBoxButton::YesNo

type System.Windows.MessageBoxImage::Question

type System.Windows.MessageBoxResult::Yes

type System.Windows.MessageBoxOptions::RightAlign

)

How can i ask wich button was pressed?

 


#WPFMessageBox

I selected Solution Explorer and nothing changed, could not see PresentationFramework.

Is it possible that when I selected the type of framework that I selected one that does not support this type of code.

It has been some time since I started this project and I think I chose Windows Forms Application.


Hi!

I have a WPF MessageBox like this:

invoke type System.Windows.MessageBox::Show(

"Mein Text",

"Kopfzeile",

type System.Windows.MessageBoxButton::YesNo

type System.Windows.MessageBoxImage::Question

type System.Windows.MessageBoxResult::Yes

type System.Windows.MessageBoxOptions::RightAlign

)

How can i ask wich button was pressed?

 


#WPFMessageBox

I selected Solution Explorer and nothing changed, could not see PresentationFramework.

Is it possible that when I selected the type of framework that I selected one that does not support this type of code.

It has been some time since I started this project and I think I chose Windows Forms Application.


Hi!

I have a WPF MessageBox like this:

invoke type System.Windows.MessageBox::Show(

"Mein Text",

"Kopfzeile",

type System.Windows.MessageBoxButton::YesNo

type System.Windows.MessageBoxImage::Question

type System.Windows.MessageBoxResult::Yes

type System.Windows.MessageBoxOptions::RightAlign

)

How can i ask wich button was pressed?

 


#WPFMessageBox

I selected Solution Explorer and nothing changed, could not see PresentationFramework.

Is it possible that when I selected the type of framework that I selected one that does not support this type of code.

It has been some time since I started this project and I think I chose Windows Forms Application.


Hi!

I have a WPF MessageBox like this:

invoke type System.Windows.MessageBox::Show(

"Mein Text",

"Kopfzeile",

type System.Windows.MessageBoxButton::YesNo

type System.Windows.MessageBoxImage::Question

type System.Windows.MessageBoxResult::Yes

type System.Windows.MessageBoxOptions::RightAlign

)

How can i ask wich button was pressed?

 


#WPFMessageBox

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.


Hi!

I have a WPF MessageBox like this:

invoke type System.Windows.MessageBox::Show(

"Mein Text",

"Kopfzeile",

type System.Windows.MessageBoxButton::YesNo

type System.Windows.MessageBoxImage::Question

type System.Windows.MessageBoxResult::Yes

type System.Windows.MessageBoxOptions::RightAlign

)

How can i ask wich button was pressed?

 


#WPFMessageBox

OK, that worked, Thanks.