zoukankan      html  css  js  c++  java
  • C#Windows的HelloWorld

    在MSDN中找到Form类:MSDN-->.NET开发-->.NET Framework SDK 2.0-->Class Library Reference -->System.Windows.Forms 命名空间

    http://msdn.microsoft.com/zh-cn/library/system.windows.forms%28v=vs.80%29.aspx

    阅读文档,解决以下问题:

    1.

    public class Form1 : Form
    {
        [STAThread]
        public static void Main()
        {
            // Start the application.
            Application.Run(new Form1());
        }
    
        private Button button1;
        private ListBox listBox1;
    
        public Form1()
        {
            button1 = new Button();
            button1.Left = 200;
            button1.Text = "Exit";
            button1.Click += new EventHandler(button1_Click);
    
            listBox1 = new ListBox();
            this.Controls.Add(button1);
            this.Controls.Add(listBox1);
        }
    
        private void button1_Click(object sender, System.EventArgs e)
        {
            int count = 1;
            // Check to see whether the user wants to exit the application.
            // If not, add a number to the list box.
            while (MessageBox.Show("Exit application?", "", 
                MessageBoxButtons.YesNo)==DialogResult.No)
            {
                listBox1.Items.Add(count);
                count += 1;
            }
    
            // The user wants to exit the application. 
            // Close everything down.
            Application.Exit();
        }
    }
  • 相关阅读:
    Jmeter+ant+jenkin接口自动化发邮件
    BadBoy 参数化录制,并导入JMeter
    Jmeter 移动端录制
    Pytest 操作
    Pytest框架简介与安装
    Fiddler iOS抓包
    Fiddler Android APP 抓包
    random的使用
    scanner的使用与匿名对象的使用
    标准的类,API的初步使用
  • 原文地址:https://www.cnblogs.com/feng-fan/p/3320944.html
Copyright © 2011-2022 走看看