通过StatusStrip显示窗体状态栏

同时将状态栏分成三部分

居左边显示相关文字信息

中间空白显示

居右边显示时间信息

1.创建窗体及添加StatusStrip

  默认StatusStrip名称为statusStrip1

2.在statusStrip1的Items属性中

  添加三个StatusLabel

  默认名称为toolStripStatusLabel1,2,3

  按1,2,3的顺序排列

3.修改toolStripStatusLabel1的Text属性

  为相关文字如”欢迎使用本系统”

4.修改toolStripStatusLabel2的Text属性 为空

  Sprint属性为True

  BorderSides属性为Left,Right

5.修改toolStripStatusLabel3的Text属性 为空

  在Form的Load事件中 修改其显示为当前时间

  this.toolStripStatusLabel3.Text = “登录时间:” + DateTime.Now.ToString(“yyyy-MM-dd hh:mm:ss”);

6.如果要使状态栏时间信息随操作系统当前时间不停的改变

  则可以通过增加Timer控件来实现

  增加Timer控件 timer1

  编写其Tick事件为

  private void timer1_Tick(object sender, EventArgs e)

  {

      this.toolStripStatusLabel3.Text = “系统当前时间:” + DateTime.Now.ToString(“yyyy-MM-dd hh:mm:ss”);

  }

 

  在Form的Load事件中 对timer1进行相关设置

  private void MainForm_Load(object sender, EventArgs e)

  {

    this.toolStripStatusLabel3.Text = “系统当前时间:” + DateTime.Now.ToString(“yyyy-MM-dd hh:mm:ss”);

    this.timer1.Interval=1000;

    this.timer1.Start();

StatusStrip 分类: C# 2015-07-23 11:58 2人阅读 评论(0) 收藏的更多相关文章

  1. UIAlertController高级之嵌入其他控件 分类: ios技术 2015-02-02 11:58 96人阅读 评论(0) 收藏

    在编码过程中,我们经常遇到需要这样一个效果,就是弹出框的嵌套; 举个最简单的例子,比如你要选择时间,必然需要一个时间选择器DatePicker.但是这个选择器又是在你点击某按钮时弹出,弹出方式最常见的 ...

  2. hdu 1057 (simulation, use sentinel to avoid boudary testing, use swap trick to avoid extra copy.) 分类: hdoj 2015-06-19 11:58 25人阅读 评论(0) 收藏

    use sentinel to avoid boudary testing, use swap trick to avoid extra copy. original version #include ...

  3. Design T-Shirt 分类: HDU 2015-06-26 11:58 7人阅读 评论(0) 收藏

    Design T-Shirt Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others) T ...

  4. 百度编辑器UEditor ASP.NET示例Demo 分类: ASP.NET 2015-01-12 11:18 346人阅读 评论(0) 收藏

    在百度编辑器示例代码基础上进行了修改,封装成类库,只需简单配置即可使用. 完整demo下载 版权声明:本文为博主原创文章,未经博主允许不得转载.

  5. Least Common Ancestors 分类: ACM TYPE 2014-10-19 11:24 84人阅读 评论(0) 收藏

    #include <iostream> #include <cstdio> #include <cstring> #include <cmath> #i ...

  6. 二分图匹配(KM算法)n^4 分类: ACM TYPE 2014-10-04 11:36 88人阅读 评论(0) 收藏

    #include <iostream> #include<cstring> #include<cstdio> #include<cmath> #incl ...

  7. Segment Tree with Lazy 分类: ACM TYPE 2014-08-29 11:28 134人阅读 评论(0) 收藏

    #include<stdio.h> #include<string.h> #include<algorithm> using namespace std; stru ...

  8. 8大排序算法图文讲解 分类: Brush Mode 2014-08-18 11:49 78人阅读 评论(0) 收藏

    排序算法可以分为内部排序和外部排序,内部排序是数据记录在内存中进行排序,而外部排序是因排序的数据很大,一次不能容纳全部的排序记录,在排序过程中需要访问外存. 常见的内部排序算法有:插入排序.希尔排序. ...

  9. C语言之void类型及void指针 分类: C/C++ 2015-07-13 11:24 8人阅读 评论(0) 收藏

    原文网址:http://www.cnblogs.com/pengyingh/articles/2407267.html 1.概述 许多初学者对C/C 语言中的void及void指针类型不甚理解,因此在 ...

随机推荐

  1. 本地主机访问远程linux系统服务器上的jupyter notebook

    1,机器情况:服务器 centos python环境已经配置好了,在虚拟环境下安装了anaconda 并且在里面安装了jupyter notebook 2,主机是 windows     ipytho ...

  2. python实现通过企业微信发送消息

    实现了通过企业微信发送消息,平时用于运维的告警还是不错的,相对于邮件来说,实时性更高,不过就是企业微信比较麻烦,此处不做过多解释. 企业微信api的详细请看:http://work.weixin.qq ...

  3. 1144. The Missing Number (20)

    Given N integers, you are supposed to find the smallest positive integer that is NOT in the given li ...

  4. Java 多态概念、使用

    1.概念 2.多态的格式与使用 package Java12; /* 代码当中体现多态性,其实就是一句话: 父类引用指向子类对象 格式: 父类名称 对象名 = new 子类名称(): 或者: 接口名称 ...

  5. java 简单工厂&抽象工厂

    工厂模式:就是提供一个实例化对象的接口,让子类去决定实现哪个具体对象 1:简单工厂 public abstract class Person { } public class XiaoLi exten ...

  6. 学习旧岛小程序 (5) observer 函数中修改属性的值

    不要在一个属性的 observer  函数中修改属性的值 不然会造成内存泄露 错误代码: properties: { /* 期刊号 */ index: { type: String, observer ...

  7. c++11 指针空值

    1. 引入nullptr的必要性: 典型的指针初始化是将其指向一个空的位置.比如: int* my_ptr = 0; int* my_ptr = NULL; 一般情况下,NULL是一个宏定义. #un ...

  8. lightoj1094 - Farthest Nodes in a Tree

    1094 - Farthest Nodes in a Tree   PDF (English) Statistics Forum Time Limit: 2 second(s) Memory Limi ...

  9. git cherry-pick的使用

    [Git] Git整理(五) git cherry-pick的使用 2018年07月13日 23:49:16 FightFightFight 阅读数:31649    版权声明:本文为博主原创文章,未 ...

  10. apache主要配置详解

    1. # Deny access to the entirety of your server's filesystem. You must # explicitly permit access to ...