MessageBox Result - pressed buton.

P

Przemek

Hi.
I have MessageBox likt that:
MessageBox::Show(S"string1",S"string2", MesageBoxButton::YesNo,
MessageBoxIcon::Error);

How can I get result of pressed button from that MessageBox - I trying to do
something like that:
if(DialogResult::Yes == MessageBox::Show(......))
{
......
}

But whatever I press in MessageBox, 'IF' is always true!
I can change 'DialogResult::Yes' with any numerical value it's still true -
what going on?:)
Thanks for wrote.
 
C

Claes Bergefall

The code you have should work.
What does MessageBox::Show return
if you put it on a separate row?

/claes
 
H

Herfried K. Wagner [MVP]

* "Przemek said:
I have MessageBox likt that:
MessageBox::Show(S"string1",S"string2", MesageBoxButton::YesNo,
MessageBoxIcon::Error);

How can I get result of pressed button from that MessageBox - I trying to do
something like that:
if(DialogResult::Yes == MessageBox::Show(......))

Set a breakpoint and check what value 'MessageBox::Show' returns.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top