c# winform实现气泡提示窗口
来源:互联网 发布:尊宝比萨加盟 知乎 编辑:程序博客网 时间:2024/05/29 03:26
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
namespace WindowsFormsApplication60
{
public partial class Form1 : Form
{
private Button btnShow = null;
private Button btnClose = null;
private NotifyIcon notifyIcon1 = null;
public Form1()
{
InitializeComponent();
this.Load+=new EventHandler(Form1_Load);
}
private void Form1_Load(object sender, EventArgs e)
{
btnShow = new Button();//显示气泡提示窗口
btnShow.Text = "show";
btnShow.Click += new EventHandler(btnShow_Click);
btnShow.Location = new Point(10, 10);
this.Controls.Add(btnShow);
btnClose = new Button();//影藏气泡提示窗口
btnClose.Text = "close";
btnClose.Click += new EventHandler(btnClose_Click);
btnClose.Location = new Point(10 + btnShow.Width + 10, 10);
this.Controls.Add(btnClose);
notifyIcon1 = new NotifyIcon();
notifyIcon1.MouseMove += new MouseEventHandler(notifyIcon1_MouseMove);
notifyIcon1.Icon = global::WindowsFormsApplication60.Properties.Resources.Lintway;
}
/// <summary>
/// 鼠标移过显示时间
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
void notifyIcon1_MouseMove(object sender, MouseEventArgs e)
{
this.notifyIcon1.ShowBalloonTip(1000, "当前时间:", DateTime.Now.ToLocalTime().ToString(), ToolTipIcon.Info);//显示气泡提示
}
/// <summary>
/// 影藏时间
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
void btnClose_Click(object sender, EventArgs e)
{
this.notifyIcon1.Visible = false;//设置提示控件不可见
}
/// <summary>
/// 显示时间
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
void btnShow_Click(object sender, EventArgs e)
{
this.notifyIcon1.Visible = true;//设置提示控件可见
this.notifyIcon1.ShowBalloonTip(1000, "当前时间:", DateTime.Now.ToLocalTime().ToString(), ToolTipIcon.Info);//显示气泡提示
}
}
}
- c# winform实现气泡提示窗口
- c# winform实现气泡提示窗口
- C# WinForm实现气泡提示效果
- c# winform 如何实现弹出气泡状的提示框
- c# winform 如何实现弹出气泡状的提示框
- winform气泡提示
- c# winform notifyIcon 系统托盘图标闪动 气泡提示
- c# winform程序右下角显示气泡提示效果
- 气泡提示窗口
- 气泡提示窗口
- C# 气泡提示方法
- 在C#中实现系统拖盘处的气泡提示
- 在C#中实现系统拖盘处的气泡提示
- C#中实现类似QQ的气泡提示
- C# WinForm 给某动态控件设置 IsBalloon = true的ToolTip 即 气泡状提示
- C#实现WinForm窗口最小化到系统托盘
- C#实现WinForm窗口最小化到系统托盘
- C#实现WinForm窗口最小化到系统托盘
- csdn第二次实训最后一次课
- 英文网站 高质量反向链接的20个方法
- QT2.2.0中多线程中遇到undefined reference to `pthread_create'问题的解决
- getchar()函数的作用
- 关于MLS--------MLS实现三层交换的过程
- c# winform实现气泡提示窗口
- sap-fi-as-在前年度创建资产并提累计折旧
- 搜索引擎提交的登录入口
- c# winform通过webservice 上传文件
- 组合测试法中的全对偶测试法
- How to set up a penetration testing lab
- 暗时间
- c# winform通过webservice下载文件
- CISCO CEF(Cisco Express Forwarding,Cisco特快交换) 详解