01-窗体技巧/限制窗体大小/RestrictSize/Form1.cs

(完整代码) 732B

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

namespace RestrictSize
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        int FrmWidth = 70;
        int FrmHeight = 70;
        private void Form1_Resize(object sender, EventArgs e)
        {
            if (this.Width <= FrmWidth)
            {
                this.Width = FrmWidth;
            }
            if (this.Height <= FrmHeight)
            {
                this.Height = FrmHeight;
            }
        }
    }
}

24 小时内免费解锁 3 个项目,之后 1 积分/个。 规则说明

AI 解读 AI

登录后可用,每次 10 积分,解读结果公开显示在下面。

还没有人解读过这个文件。