当前位置:网站首页>C application interface development foundation - form control (5) - grouping control
C application interface development foundation - form control (5) - grouping control
2022-07-05 19:28:00 【DXB2021】
Group class control
Grouped controls have containers (Panel) Control 、 Group box (GroupBox) Control 、 tab (TabControl) Controls, etc. .
Container controls
Container controls are controlled by System.Windows.Forms.Panel Class provides the . This control is equivalent to a container , The main function is to put other controls together on a panel , Make these controls easier to manage .
Programming , To make a “ Download Explorer ”.
The development steps are as follows :
1、 First, in the Form1 Add three... To the form Button Control , And modify the Text attribute ; Then add one more Panel Control , And add the Size Property is set to “307,181”.
2、 Then create three new forms , , respectively, by Regular.cs General form 、Download.cs Download forms and Appearance.cs Appearance form , And add corresponding controls for the three forms . We need to pay attention to , After the new form is completed , They also need to be Size Property is set to “307,181”.
Right click , Select Rename .
3、 Last in Form1.cs In file , Add three Button The control of Click event .
Before code
After code :
The code is as follows :
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 WindowsFormsApp1
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
Regular myRegular=new Regular();
myRegular.TopLevel = false;
this.panel1.Controls.Add(myRegular);
myRegular.FormBorderStyle= FormBorderStyle.None;
myRegular.BringToFront();
myRegular.Show();
}
private void button2_Click(object sender, EventArgs e)
{
Download myDownload = new Download();
myDownload.TopLevel = false;
this.panel1.Controls.Add(myDownload);
myDownload.FormBorderStyle = FormBorderStyle.None;
myDownload.BringToFront();
myDownload.Show();
}
private void button3_Click(object sender, EventArgs e)
{
Appearance myAppearance = new Appearance();
myAppearance.TopLevel = false;
this.panel1.Controls.Add(myAppearance);
myAppearance.FormBorderStyle = FormBorderStyle.None;
myAppearance.BringToFront();
myAppearance.Show();
}
}
}
The operation results are as follows :
Click on , No response , Run failed .
Three windows redesigned :
Run again :
Group box control
The grouping box control is composed of System.Windows.Forms.GroupBox Class provides the , The function is to provide recognizable grouping for other controls , Multiple single choices can be realized on the same page RadioButton Control . Usually , Use the grouping box to subdivide the form by function .
Tab controls
A tab control is a tab control , In practice It is often used in programming , The function of this control is to combine related components into a series of tab pages .
1、 Add and remove TabControl Control
2、 Add and remove tabs programmatically .
边栏推荐
- 城链科技数字化创新战略峰会圆满召开
- acm入门day1
- 打新债在哪里操作开户是更安全可靠的呢
- Do you know several assertion methods commonly used by JMeter?
- IBM has laid off 40 + year-old employees in a large area. Mastering these ten search skills will improve your work efficiency ten times
- PHP uses ueditor to upload pictures and add watermarks
- Vagrant2.2.6 supports virtualbox6.1
- Go语言 | 02 for循环及常用函数的使用
- HAC集群修改管理员用户密码
- 集合
猜你喜欢
全网最全的低代码/无代码平台盘点:简道云、伙伴云、明道云、轻流、速融云、集简云、Treelab、钉钉·宜搭、腾讯云·微搭、智能云·爱速搭、百数云
司空见惯 - 英雄扫雷鼠
使用easyexcel模板导出的两个坑(Map空数据列错乱和不支持嵌套对象)
数据库 逻辑处理功能
XaaS 陷阱:万物皆服务(可能)并不是IT真正需要的东西
Ten years at sea: old and new relay, dark horse rising
Hiengine: comparable to the local cloud native memory database engine
Oracle故障处理:Ora-10873:file * needs to be either taken out of backup or media recovered
Common interview questions in Android, 2022 golden nine silver ten Android factory interview questions hit
大厂面试必备技能,2022Android不死我不倒
随机推荐
PG basics -- Logical Structure Management (user and permission management)
How to apply smart contracts more wisely in 2022?
JS solution force deduction daily question (12) - 556 Next larger element III (2022-7-3)
基于FPGA的超声波测距
Hiengine: comparable to the local cloud native memory database engine
【硬核干货】数据分析哪家强?选Pandas还是选SQL
What do software test engineers do? How about the prospect of treatment?
[Collection - industry solutions] how to build a high-performance data acceleration and data editing platform
Necessary skills for interview in large factories, 2022android will not die, I will not fall
四万字长文说operator new & operator delete
手机开户选择哪家券商公司比较好哪家平台更安全
手把手教你处理 JS 逆向之图片伪装
Hiengine: comparable to the local cloud native memory database engine
C# 语言的高级应用
Vagrant2.2.6 supports virtualbox6.1
CF: B. almost Ternary Matrix [symétrie + règles de recherche + Construction + I am Construction Waste]
太牛了,看这篇足矣了
块编辑器如何选择?印象笔记 Verse、Notion、FlowUs
Blue sky drawing bed Apple quick instructions
Oracle fault handling: ora-10873:file * needs to be either taken out of backup or media recovered