tags:

views:

2323

answers:

3

I would like to keep the overhead at a minimum. Right now I have:

// Launch a Message Box with advice to the user
DialogResult result = MessageBox::Show("This may take awhile, do you wish to continue?", "Warning", MessageBoxButtons::YesNo, MessageBoxIcon::Exclamation);

// The test will only be launched if the user has selected Yes on the Message Box
if(result == DialogResult::Yes)
{
    // Execute code
}

Unfortunately my client would prefer "Continue" and "Cancel" in place of the default "Yes" and "No" button text. It seems like there should be an easy way to do this.

+2  A: 

You can use "OK" and "Cancel"

By substituting MessageBoxButtons::YesNo with MessageBoxButtons::OKCancel

MessageBoxButtons Enum

Short of that you would have to create a new form, as I don't believe the Enum can be extended.

Corin
A: 
Andrew Dunaway
A: 

Well for starters there is qiute a few errors i went through them if youdidnt minded sorry for the bad grammer im ust a kid well a highscholer at least alyways this->Size = System::Drawing::Size(420, 150); this->Text="Warning"; this->AcceptButton=continueButton; this->CancelButton=cancelButton_; this->FormBorderStyle= ::FormBorderStyle::FixedDialog; this->StartPosition= FormStartPosition::CenterScreen; this->MaximizeBox=false; this->MinimizeBox=false; this->ShowInTaskbar=false; the symbal > is an invallid syntax and can not be used when running scripts .2 you can not use parentethes when calling a subit took me almost 3 hours of work to get his script running but i finaly got

x=msgbox::CustomMessageBox() this-Size =System::Drawing::Size420, 150 this-Text="Warning" this-AcceptButton=continueButton this-CancelButton=cancelButton this-FormBorderStyle=formBorderStyle::FixedDialog this-StartPosition=formStartPosition::CenterScreen this-MaximizeBox=false this-MinimizeBox=false this-ShowInTaskbar=false

Warning Label
warningLabel_=gcnewLabel()
warningLabel_-Text="This may take awhile, do you wish to continue?"
warningLabel_-Location=Point5,5
warningLabel_-Size=SystemDrawingSize400, 78
Controls-AddwarningLabel

ContinueButton
continueButton_=gcnewButton()
continueButton_-Text="Continue"
continueButton_-Location=Point105,87
continueButton_-Size=System::DrawingSize70,22
continueButton_-Click=gcnewSystemEventHandler(this, CustomMessageBoxbtnContinue_Click)
Controls-Add(continueButton)

Cancel Button
cancelButton_ = gcnewButton()
cancelButton_-Text="Cancel"
cancelButton_-Location=Point237,87
cancelButton_-Size=System::DrawingSize70,22
cancelButton_-Click =gcnewSystemEventHandlerthis, CustomMessageBox::btnCancel_Click
Controls-Add(cancelButton)
I don't even understand what your attempting to accomplish here.
WedTM