FormStudent.cs

(开头部分) 3KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

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 学生管理
{
    public partial class FormStudent : Form
    {
        public Button lightbuton;

        public FormStudent()
        {
            InitializeComponent();
        }

        public void ShowForm(Form form)//对右边panel的显示设定
        {
            foreach(Control fb in this.Pl_show.Controls)
            {
                if(fb is Form)
                {
                    ((Form)fb).Close();//关闭之前打开的文件
                }
            }
            this.Pl_show.Controls.Clear();//清除panel内的所有控件
            form.TopLevel = false;//将该子窗设为非顶级控件
            form.FormBorderStyle = FormBorderStyle.None;//去掉边框
            form.Dock = DockStyle.Fill;//子窗体随容器大小自动调整
            form.Parent = this.Pl_show;//设置父容器为当前窗口
            form.Show();

        }

       public void Setbutton(Button btn)//设置高亮button
        {
            foreach(Control c in panel1.Controls)
            {
                Button b = c as Button;
                if(null != b)
                {
                b.BackColor = Color.FromArgb(60, 179, 113);//背景变成与panel一样
                b.ForeColor = Color.FromArgb(255, 255, 255);//字体颜色复原
                b.TextAlign = ContentAlignment.MiddleCenter;//字体中对齐
                b.FlatAppearance.MouseOverBackColor = Color.FromArgb(0,250,154);//鼠标停留时颜色
                }
                
            }

            //当选中某button时
            if(btn != null)
            {
                btn.BackColor = Color.FromArgb(240, 240, 240);//背景变成与Pt_show一样
                btn.ForeColor = Color.FromArgb(60, 170, 113);//字体颜色变亮
                btn.TextAlign = ContentAlignment.MiddleRight;//字体右对齐
后面还有 37 行代码,解锁后查看完整代码

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

AI 解读 AI

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

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