当前位置:网站首页>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 .
边栏推荐
- Fundamentals of machine learning (III) -- KNN / naive Bayes / cross validation / grid search
- Oracle故障处理:Ora-10873:file * needs to be either taken out of backup or media recovered
- okcc呼叫中心有什么作用
- Debezium系列之:postgresql从偏移量加载正确的最后一次提交 LSN
- Postman core function analysis - parameterization and test report
- Reinforcement learning - learning notes 4 | actor critical
- HiEngine:可媲美本地的云原生内存数据库引擎
- Explain in detail the functions and underlying implementation logic of the groups sets statement in SQL
- acm入门day1
- Summer Challenge database Xueba notes, quick review of exams / interviews~
猜你喜欢
全网最全的低代码/无代码平台盘点:简道云、伙伴云、明道云、轻流、速融云、集简云、Treelab、钉钉·宜搭、腾讯云·微搭、智能云·爱速搭、百数云
C#应用程序界面开发基础——窗体控制(5)——分组类控件
Do you know several assertion methods commonly used by JMeter?
UWB ultra wideband positioning technology, real-time centimeter level high-precision positioning application, ultra wideband transmission technology
Teach you to deal with JS reverse picture camouflage hand in hand
IFD-x 微型红外成像仪(模块)关于温度测量和成像精度的关系
Django uses mysqlclient service to connect and write to the database
Xaas trap: all things serve (possible) is not what it really needs
#夏日挑战赛#数据库学霸笔记,考试/面试快速复习~
Hiengine: comparable to the local cloud native memory database engine
随机推荐
IBM has laid off 40 + year-old employees in a large area. Mastering these ten search skills will improve your work efficiency ten times
Debezium系列之:IDEA集成词法和语法分析ANTLR,查看debezium支持的ddl、dml等语句
ELK分布式日志分析系统部署(华为云)
okcc呼叫中心有什么作用
Information / data
测试外包公司怎么样?
JS solution force deduction daily question (12) - 556 Next larger element III (2022-7-3)
Debezium系列之:postgresql从偏移量加载正确的最后一次提交 LSN
[performance test] jmeter+grafana+influxdb deployment practice
#夏日挑战赛#数据库学霸笔记,考试/面试快速复习~
HiEngine:可媲美本地的云原生内存数据库引擎
太牛了,看这篇足矣了
【硬核干货】数据分析哪家强?选Pandas还是选SQL
Explain in detail the functions and underlying implementation logic of the groups sets statement in SQL
The binary string mode is displayed after the value with the field type of longtext in MySQL is exported
After the company went bankrupt, the blackstones came
【obs】QString的UTF-8中文转换到blog打印 UTF-8 char*
Reinforcement learning - learning notes 4 | actor critical
基于FPGA的超声波测距
Ten years at sea: old and new relay, dark horse rising