窗體方法.cs

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace _9_17
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }
        private void Form1_Load(object sender, EventArgs e)
        {
            this.FormBorderStyle = FormBorderStyle.Sizable;
            this.Text = "裝入窗體";
            this.BackgroundImage = Image.FromFile("11.png");
        }
        private void Form1_KeyPress(object sender, KeyPressEventArgs e)
        {
            this.Text = "接收按鍵";
            this.Visible = false ;
            Form2 frm = new Form2();
            frm.Show();
            this.Visible = true;
        }
        private void Form1_DoubleClick(object sender, EventArgs e)
        {
            this.Text = "雙擊窗口";
            Form2 frm = new Form2();
            this.Visible = false;
            frm.ShowDialog();
            this.Visible = true;
        }
        private void Form1_SizeChanged(object sender, EventArgs e)
        {
            this.Text = "窗體尺寸:" + this.Size.ToString();
        }
        private void Form1_LoationChanged(object sender, EventArgs e)
        {
            this.Text = "窗體位置:" + this.Location.ToString();
        }
    }
}
發佈了94 篇原創文章 · 獲贊 24 · 訪問量 12萬+
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章