myform12.cs

来自「Hello,This is document of WindownForm」· CS 代码 · 共 44 行

CS
44
字号
[assembly: System.Reflection.AssemblyVersion("1.2")]

namespace MyNamespace
{
	using System;	
	using System.Windows.Forms;

	public class MyForm : System.Windows.Forms.Form
	{
		private Button btnLoad;	
		private PictureBox imgPhoto;

        public MyForm()
        {
		// Constructor
		this.Text = "Hello Form 1.2";

		// Create and configure the Button
		btnLoad = new Button();
		btnLoad.Text = "&Load";
		btnLoad.Left = 10;
		btnLoad.Top = 10;

		// Create and configure the PictureBox
		imgPhoto = new PictureBox();
		imgPhoto.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
		imgPhoto.Width = this.Width / 2;			
		imgPhoto.Height = this.Height / 2;			
		imgPhoto.Left = (this.Width - imgPhoto.Width) / 2;
		imgPhoto.Top = (this.Height - imgPhoto.Height) / 2;

		// Add our new controls to the Form
		this.Controls.Add(btnLoad);
		this.Controls.Add(imgPhoto);	
        }


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

⌨️ 快捷键说明

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