当前位置:网站首页>C# control StatusStrip use
C# control StatusStrip use
2022-07-31 13:15:00 【dusk and starry sky】
StatusStrip control: Status bar control.Usually at the bottom of the form, it is used to display information about objects on the form, or to display application information.
Includes: StatusLabel, progressBar, DropDownButton, and splitButton controls.Text, icons, or both can be displayed.

Example usage: this.toolStripStatusLabel2.Text = DateTime.Now.ToShortDateString();//Display the current date of the system on the taskbar
First learn about StatusStrip: The preferred StatusStrip is a control in the Form, and it is also a large control, which contains many sub-controls, and these sub-controls are stored in the control group.
When we want to use StatusStrip,
First define the StatusStrip,
Then define the ToolStrip control,
Define the ToolStrip control group again,
Third, add the ToolStrip control to the control group,
Fourth, add the control group to the StatusStrip,
Finally, the StatusStrip should be added to the form.
Example:
In this example, a taskbar is added to the Form form, and Test is displayed on the left side of the taskbar.
First, the addition method in design mode is:
Add a StatusStrip control to the form.Add a ToolStripLabel control to the StatusStrip.Set the Text property of the ToolStripLabel control to the message displayed at runtime (ie, Test).
Second, the process of adding in code mode is:
Define StatusStrip
Define Control (ToolStripLabel)
Define control group (ToolStripItem)
Add the control to the control group (Items.AddRange)
Add StatusStrip to Form
public Form1()
{
InitializeComponent();
#region AddStatusStrip
//1. Define the StatusStrip to be added
StatusStrip sb = new StatusStrip();
//2.Define the controls in the StatusStrip project, where ToolStripLabel is a control similar to label, now used to display text
ToolStripLabel tsl = new ToolStripLabel();
//Text content to be displayed
tsl.Text =“Test”;
//3. Define the item to be in StatusStrip
ToolStripItem[] tsi = new ToolStripItem[1];
tsi[0] = tsl;
//4. Add the itemGo to StatusStrip
sb.Items.AddRange(tsi);
//5. Add StatusStrip to the form
this.Controls.Add(sb);
#endregion
}
MenuStrip:
Add the menu bar control MenuStrip on the form, directly press and hold the MenuStrip, and drag it to the Windows Form on the rightStatusStrip:
is used to give some hints to the user in the interface, for example, after logging in to a system, the user name, system time and other information of the logged in person will be displayed on the status bar.The text cannot be edited directly on the status bar, and other controls need to be added to assist.Click the newly added status bar control in the interface shown above, the drop-down menu as shown below will be displayed,
Including label control (StatusLabel), progress bar (ProgressBar), drop-down list button (DropDownButton), split button (SplitButton).
ToolStrip:
Drag the ToolStrip control directly into the Windows Form from the Toolbox.For beauty and interface unity, it should be dragged to the bottom of the menu bar, as shown in the following figure.边栏推荐
猜你喜欢

365-day challenge LeetCode1000 questions - Day 044 Maximum element in the layer and level traversal
![[Niu Ke brush questions - SQL big factory interview questions] NO3. E-commerce scene (some east mall)](/img/a6/8d53f5087a33c2bea8c99a5bb922da.png)
[Niu Ke brush questions - SQL big factory interview questions] NO3. E-commerce scene (some east mall)

networkx绘制度分布

golang-gin-优雅重启

ERROR 1064 (42000) You have an error in your SQL syntax; check the manual that corresponds to your

深圳某游戏研发公司每个工位都装监控,网友:堪比“坐牢”!

函数的参数

五种数据提交方式的优化

报错IDEA Terminated with exit code 1

Google Chrome(谷歌浏览器)安装使用
随机推荐
NameNode (NN) and SecondaryNameNode (2NN) working mechanism
CentOS7 installation MySQL graphic detailed tutorial
网络协议及相关技术详解
基于模糊预测与扩展卡尔曼滤波的野值剔除方法
IDEA版Postman插件Restful Fast Request,细节到位,功能好用
anaconda虚拟环境安装pytorch gpu版本
【OpenCV】-边缘检测汇总示例
战略进攻能力的重要性,要远远高于战略防守能力
Introduction to using NPM
EXCEL如何快速拆分合并单元格数据
Architecture Camp | Module 8
365-day challenge LeetCode1000 questions - Day 044 Maximum element in the layer and level traversal
Grab the tail of gold, silver and silver, unlock the programmer interview "Artifact of Brushing Questions"
log4j2的使用
Hard disk partition, expand disk C, no reshipment system, not heavy D dish of software full tutorial.
docker部署完mysql无法连接
STM32——软件SPI控制AD7705[通俗易懂]
Centos7 install mysql5.7
清除浮动的四种方式及其原理理解
SAP 电商云 Spartacus SSR Optimization Engine 几处 timeout 的执行顺序