SoFunction
Updated on 2025-03-07

Example of bubble prompt window function implemented by C# winForm

This article describes the bubble prompt window function implemented by C# winForm. Share it for your reference, as follows:

using System;
using ;
using ;
using ;
using ;
using ;
using ;
namespace WindowsFormsApplication60
{
  public partial class Form1 : Form
  {
    private Button btnShow = null;
    private Button btnClose = null;
    private NotifyIcon notifyIcon1 = null;
    public Form1()
    {
      InitializeComponent();
      +=new EventHandler(Form1_Load);
    }
    private void Form1_Load(object sender, EventArgs e)
    {
      btnShow = new Button();//Show bubble prompt window       = "show";
       += new EventHandler(btnShow_Click);
       = new Point(10, 10);
      (btnShow);
      btnClose = new Button();//Shadow bubble prompt window       = "close";
       += new EventHandler(btnClose_Click);
       = new Point(10 +  + 10, 10);
      (btnClose);
      notifyIcon1 = new NotifyIcon();
       += new MouseEventHandler(notifyIcon1_MouseMove);
       = global::;
    }
    /// <summary>
    /// Move the mouse over the display time    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    void notifyIcon1_MouseMove(object sender, MouseEventArgs e)
    {
      this.(1000, "Current time:", ().ToString(), );//Show bubble prompt    }
    /// <summary>
    /// Movie time    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    void btnClose_Click(object sender, EventArgs e)
    {
      this. = false;//Set the prompt control is not visible    }
    /// <summary>
    /// Display time    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    void btnShow_Click(object sender, EventArgs e)
    {
      this. = true;//Set the prompt control to be visible      this.(1000, "Current time:", ().ToString(), );//Show bubble prompt    }
  }
}

For more information about C# related content, please check out the topic of this site:Summary of C# form operation skills》、《Summary of WinForm control usage》、《C# data structure and algorithm tutorial》、《Tutorial on the usage of common C# controls》、《Introduction to C# object-oriented programming tutorial"and"Summary of thread usage techniques for C# programming

I hope this article will be helpful to everyone's C# programming.