• 大小: 0.05M
    文件类型: .zip
    金币: 1
    下载: 0 次
    发布日期: 2021-02-23
  • 语言: C#
  • 标签: 切换  界面  

资源简介

点击按钮显示对应界面(不是隐藏在显示而是左边按钮右边是面板)

完美解决窗体之间来回切换的不便

资源截图

代码片段和文件信息

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 panle窗体切换
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }
        private void ClosePreForm()  
        {
            foreach (Control item in this.pnlMain.Controls)
            {
                if (item is Form)
                {
                    Form objControl = (Form)item;
                    objControl.Close();
                }

            }
        }
        private void OpenForm(Form objFrm)
        {
            //嵌入子窗体到父窗体中,把添加学员信息嵌入到主窗体右侧
            objFrm.TopLevel = false; //将子窗体设置成非最高层,非顶级控件
            objFrm.WindowState = FormWindowState.Maximized;//将当前窗口设置成最大化
            objFrm.FormBorderstyle = FormBorderstyle.None;//去掉窗体边框
            objFrm.Parent = this.pnlMa

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2020-06-16 09:16  panle窗体切换\
     目录           0  2020-06-16 09:19  panle窗体切换\panle窗体切换\
     文件        3637  2020-06-16 09:24  panle窗体切换\panle窗体切换\Form1.Designer.cs
     文件        1678  2020-06-16 09:24  panle窗体切换\panle窗体切换\Form1.cs
     文件        5817  2020-06-16 09:24  panle窗体切换\panle窗体切换\Form1.resx
     文件        3312  2020-06-17 20:31  panle窗体切换\panle窗体切换\NameRule.Designer.cs
     文件         653  2020-06-17 20:31  panle窗体切换\panle窗体切换\NameRule.cs
     文件        5817  2020-06-17 20:31  panle窗体切换\panle窗体切换\NameRule.resx
     文件         498  2020-06-16 09:15  panle窗体切换\panle窗体切换\Program.cs
     目录           0  2020-06-16 09:15  panle窗体切换\panle窗体切换\Properties\
     文件        1366  2020-06-16 09:15  panle窗体切换\panle窗体切换\Properties\AssemblyInfo.cs
     文件        2886  2020-06-16 09:15  panle窗体切换\panle窗体切换\Properties\Resources.Designer.cs
     文件        5612  2020-06-16 09:15  panle窗体切换\panle窗体切换\Properties\Resources.resx
     文件        1104  2020-06-16 09:15  panle窗体切换\panle窗体切换\Properties\Settings.Designer.cs
     文件         249  2020-06-16 09:15  panle窗体切换\panle窗体切换\Properties\Settings.settings
     目录           0  2020-06-16 09:15  panle窗体切换\panle窗体切换\bin\
     目录           0  2020-06-16 09:19  panle窗体切换\panle窗体切换\bin\Debug\
     文件       10752  2020-06-17 20:31  panle窗体切换\panle窗体切换\bin\Debug\panle窗体切换.exe
     文件       30208  2020-06-17 20:31  panle窗体切换\panle窗体切换\bin\Debug\panle窗体切换.pdb
     文件       11600  2020-06-17 20:31  panle窗体切换\panle窗体切换\bin\Debug\panle窗体切换.vshost.exe
     文件         490  2019-03-19 12:46  panle窗体切换\panle窗体切换\bin\Debug\panle窗体切换.vshost.exe.manifest
     目录           0  2020-06-16 09:15  panle窗体切换\panle窗体切换\obj\
     目录           0  2020-06-16 09:15  panle窗体切换\panle窗体切换\obj\x86\
     目录           0  2020-06-17 20:31  panle窗体切换\panle窗体切换\obj\x86\Debug\
     文件        5420  2020-06-17 09:25  panle窗体切换\panle窗体切换\obj\x86\Debug\DesignTimeResolveAssemblyReferences.cache
     文件        6365  2020-06-17 20:31  panle窗体切换\panle窗体切换\obj\x86\Debug\DesignTimeResolveAssemblyReferencesInput.cache
     目录           0  2020-06-20 11:19  panle窗体切换\panle窗体切换\obj\x86\Debug\TempPE\
     文件         180  2020-06-16 09:24  panle窗体切换\panle窗体切换\obj\x86\Debug\panle窗体切换.Form1.resources
     文件         180  2020-06-17 20:31  panle窗体切换\panle窗体切换\obj\x86\Debug\panle窗体切换.NameRule.resources
     文件         180  2020-06-16 09:19  panle窗体切换\panle窗体切换\obj\x86\Debug\panle窗体切换.Properties.Resources.resources
     文件         969  2020-06-17 20:31  panle窗体切换\panle窗体切换\obj\x86\Debug\panle窗体切换.csproj.FileListAbsolute.txt
............此处省略7个文件信息

评论

共有 条评论