foobar.cs

来自「学生注册管理系统」· CS 代码 · 共 42 行

CS
42
字号
using System;
using System.Windows.Forms;
using System.Drawing;

public class FooBar : Form {

  Button pushMeButton;
  Button barButton;

  public FooBar() {

    // Create Button
    pushMeButton = new Button(); 
    pushMeButton.Text = "Foo";
    pushMeButton.Height = 35;
    pushMeButton.Width = 80;
    pushMeButton.Top = 10;
    pushMeButton.Left = 28;

    barButton = new Button(); 
    barButton.Text = "Bar";
    barButton.Height = 35;
    barButton.Width = 80;
    barButton.Top = 60;
    barButton.Left = 28;

    // Add the Button to the Form
    this.Controls.Add(pushMeButton);
    this.Controls.Add(barButton);

    // Size the Form and make it visible
    this.Height = 130;
    this.Width = 145;
    this.StartPosition = FormStartPosition.CenterScreen;
    this.Visible = true;
  }

  static void Main() {
    Application.Run(new FooBar());
  }
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?