zoukankan      html  css  js  c++  java
  • MessageBox

     private void validateUserEntry2()
        {

            // Checks the value of the text.

            if(serverName.Text.Length == 0)
            {

                // Initializes the variables to pass to the MessageBox.Show method.

                string message = "You did not enter a server name. Cancel this operation?";
                string caption = "No Server Name Specified";
                MessageBoxButtons buttons = MessageBoxButtons.YesNo;
                DialogResult result;

                // Displays the MessageBox.

                result = MessageBox.Show(this, message, caption, buttons,
                    MessageBoxIcon.Question, MessageBoxDefaultButton.Button1,
                    MessageBoxOptions.RightAlign);

                if(result == DialogResult.Yes)
                {

                    // Closes the parent form.

                    this.Close();

                }

            }





    C#]
    protected void button1_Click(object sender, System.EventArgs e) {
       if(textBox1.Text == "") {
          MessageBox.Show("You must enter a name.", "Name Entry Error",
             MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
       }
       else {
          // Code to act on the data entered would go here.
       }
    }
  • 相关阅读:
    linux c socket
    solr初印象 转载自《闵晓荣(jarorwar)的博客》
    rainymood.com雨声
    一份不错的学习c networking programming的教程
    Drivel — 离线 Blog 客户端
    鲁豫老了
    geek site
    学车
    这个网站的气场有点强,我感受到了
    .NET中现有的 ORM 工具
  • 原文地址:https://www.cnblogs.com/VirtualMJ/p/MessageBox.html
Copyright © 2011-2022 走看看