C#+dialog box

  • 12 years ago

    hi all,

     please send some examples of dialogbox in C# .NET. i m confused i have to ask the user whether to ovewrite the existing table or create new with new name.

     

     

    thanks
     

  • 12 years ago

    Hi there,

    Are you want to show a MessageBox?

     

                if (MessageBox.Show("This is a test...",
    "Test Message",
    MessageBoxButtons.YesNo,
    MessageBoxIcon.Question,
    MessageBoxDefaultButton.Button2) == DialogResult.Yes)
    {
    // Do some things
    }
  • 12 years ago

     What if the result is not valid and i want to call the form to load?

  • 12 years ago

    Hi,

     

                if (MessageBox.Show("This is a test...",
    "Test Message",
    MessageBoxButtons.YesNo,
    MessageBoxIcon.Question,
    MessageBoxDefaultButton.Button2) == DialogResult.Yes)
    {
    AboutBox1 aboutDialog = new AboutBox1();
    aboutDialog.ShowDialog();
    }
    else
    this.Close();

Post a reply

Enter your message below

Sign in or Join us (it's free).

Contribute

Why not write for us? Or you could submit an event or a user group in your area. Alternatively just tell us what you think!

Our tools

We've got automatic conversion tools to convert C# to VB.NET, VB.NET to C#. Also you can compress javascript and compress css and generate sql connection strings.

“The most exciting phrase to hear in science, the one that heralds new discoveries, is not 'Eureka!' but 'That's funny...'” - Isaac Asimov