1,新建一个窗体MessageForm,在里面加一个label控件和timer

2,代码如下:

   public partial class MessageForm : Form
{
int t;
string txt; /// <summary>
/// 自定义弹窗
/// </summary>
/// <param name="time">窗体消失时间</param>
/// <param name="text">窗体提示内容</param>
public MessageForm(int time, string text)
{
t = time;
txt = text;
InitializeComponent();
}
private void timer1_Tick(object sender, EventArgs e)
{
this.Close();
} private void MessageForm_Load(object sender, EventArgs e)
{
label1.Text = txt;
timer1.Interval = t;
timer1.Start();
}
}

3,在其他窗体调用:

    MessageForm mf = new MessageForm(, "输入参数有误");
mf.Show();

最新文章

  1. java第四次作业
  2. (转)Linux NFS服务器的安装与配置
  3. android .apk安装时遇到NSTALL_FAILED_CONTAINER_ERROR错误
  4. cocos2d-x 3.0 版本 骨骼动画设置shader
  5. 细说.NET中的多线程 (三 使用Task)
  6. poj 2391 Ombrophobic Bovines(最大流+floyd+二分)
  7. freeswitch
  8. 如何获取并分析L2CAP包
  9. javascript获取以及设置光标位置
  10. How to tune SharePoint 2010 Server for better performance?
  11. 关于easyui模拟win2012桌面的一个例子系列
  12. ionic 最简单的路由形式,头部固定,下面tab切换-------一个简单的单页切换起飞了
  13. .net string类型集合转int集合
  14. Ubuntu16.04搭建OpenVPN
  15. FloatingActionButton(悬浮按钮)使用学习&lt;一&gt;
  16. Echarts动态加载柱状图和折线图混合展示的实例
  17. C#基础---------------C#正则表达式2
  18. H5保养
  19. JVM-类加载过程(Java类的生命周期)
  20. html中设置textbox的宽和高

热门文章

  1. 使用xtrabackup备份innodb引擎的数据库
  2. mysqldb mysql_config
  3. Python开课复习-10/16
  4. 2019.01.08 bzoj3809: Gty的二逼妹子序列(莫队+权值分块)
  5. 2018.11.17 hdu5829Rikka with Subset(ntt)
  6. [转]ajQuery的deferred对象详解
  7. xml 转 数组
  8. 牛客训练三:处女座和小姐姐(三)(数位dp)
  9. react native的注释
  10. hibernate映射组成关系