0

hello every boduy i need a help an i think it's the better place in the world when i can found this

so my problem ;

know i have a messagebox with retry and cancel

but now i need a new messagebox with accept retry and cancel when i can found this or how i can do that thank you for u r help ;)

5
Contributors
8
Replies
10
Views
6 Years
Discussion Span
Last Post by nick.crane
0

hey jimbojam and all around the world

but i see that to , but in my application i need to give the choice to the user and he have 3 choice , accept , retry , and cancel , but whith this methode i can't do this so per heps another solution

0

You'll have to create your own MessageBox class (call it something other than MessageBox or you'll probably have issues) and implement your own buttons.

0

in this time a crete a form with some button but , how i can init action for one button ?

0

Dear this is my Basic Tutorial to customize messagebox.show()

 DialogResult dr=MessageBox.Show("hello hassan", "name", MessageBoxButtons.YesNo,MessageBoxIcon.Error);
            if (dr==DialogResult.Yes)
            {
                MessageBox.Show("yes");

            }
            else
                MessageBox.Show("no");

Edited by mike_2000_17: Fixed formatting

0

A simple way to do what you want is to use the Yes/No/Cancel option of the MessageBox and re-phrase your question.

private void button1_Click(object sender, EventArgs e)
        {
            string message = string.Format("Press Yes to Accept,{0}No to Retry.", Environment.NewLine);
            DialogResult Result = MessageBox.Show(message, "Is This OK?",
                              MessageBoxButtons.YesNoCancel, 
                              MessageBoxIcon.Question, 
                              MessageBoxDefaultButton.Button2);
            MessageBox.Show(Result.ToString(), "Result=");
        }
0

That is a very good example of how to create a dialog box in c++ using Microsoft Foundation Classes.

This is the C# forum for Microsoft .Net!

Here a few of the more appropriate custom message box examples found using Google.

http://www.codeguru.com/csharp/.net/net_general/eventsanddelegates/article.php/c13193__2/Creating-a-Custom-Message-Box.htm
http://www.codeproject.com/KB/cs/A_Custom_Message_Box.aspx
http://www.techlicity.com/blog/dotnet-creating-a-custom-messagebox.html

Edited by nick.crane: n/a

This article has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.