How to create a OK/Cancel message box in VC...?

Hello guys!

I have a newbie question...

I want to create a OK/Cancel message Box in visual cobol and I am stuck...

All I want is to return a condition value (when I press OK return true and when I press Cancel false).

The main cbl will recognize the value and do the other things.

I have to create the messagebox from scratch?

Parents
  • Verified Answer

    What type of application are you creating, native or managed? Is this Windows Forms, WPF, ASP.NET?

    In a managed code application you would typically us the MessageBox class.
    The following works for a Windows Forms application.

    evaluate type MessageBox::Show("new message", "caption", type MessageBoxButtons::OKCancel)
    when type DialogResult::OK
    perform ...
    when type DialogResult::Cancel
    perform ...
    end-evaluate
Reply
  • Verified Answer

    What type of application are you creating, native or managed? Is this Windows Forms, WPF, ASP.NET?

    In a managed code application you would typically us the MessageBox class.
    The following works for a Windows Forms application.

    evaluate type MessageBox::Show("new message", "caption", type MessageBoxButtons::OKCancel)
    when type DialogResult::OK
    perform ...
    when type DialogResult::Cancel
    perform ...
    end-evaluate
Children
No Data