zoukankan      html  css  js  c++  java
  • C# Winform hello world

    using System.Windows.Forms;
    
    namespace ConsoleApp1
    {
        public class MyForm : Form
        {
            private TextBox txtEnter;
            private Label lblDisplay;
            private Button btnOk;
    
            public MyForm()
            {
                this.txtEnter = new TextBox();
                this.lblDisplay = new Label();
                this.btnOk = new Button();
                this.Text = "My HelloWin App!";
    
                this.txtEnter.Location = new System.Drawing.Point(16, 32);
                this.txtEnter.Size = new System.Drawing.Size(264, 20);
    
                // lblDisplay
                this.lblDisplay.Location = new System.Drawing.Point(16, 72);
                this.lblDisplay.Size = new System.Drawing.Size(264, 128);
    
                // btnOk
                this.btnOk.Location = new System.Drawing.Point(88, 224);
                this.btnOk.Text = "OK";
                this.btnOk.Click +=
                new System.EventHandler(this.btnOK_Click);
    
                // MyForm
                this.Controls.AddRange(new Control[] {
                    this.txtEnter, this.lblDisplay, this.btnOk});
            }
    
            private static void Mai1n()
            {
                Application.Run(new MyForm());
            }
    
            private void btnOK_Click(object sender, System.EventArgs e)
            {
                lblDisplay.Text = txtEnter.Text + "
    " + lblDisplay.Text;
            }
        }
    }
    

    build: csc MyForm.cs

  • 相关阅读:
    链家新房爬虫
    豆瓣电影爬虫
    电影天堂爬虫
    数组、数组和集合的区别
    Profile小试
    SQL中的case when使用小例
    使用AVAudioPlayer播放网络音乐
    播放器
    全排列问题
    由while(scanf("%d",&n)!=EOF)引出的小问题
  • 原文地址:https://www.cnblogs.com/codworm/p/12545218.html
Copyright © 2011-2022 走看看