WinForms Implement bubble Prompt window (reprint)

Source: Internet
Author: User

"Example description" bubble hint because he is beautiful and well received by most users, the user is interested in what the programmer wants to achieve. This example implements the taskbar bubble tip and runs this instance as follows: Click the prompt, the bubble tip will appear, and click the close bubble will disappear. "Key Technology" This example implements the Showballontip method of the NotifyIcon control. The NotifyIcon control represents a control that creates an icon in the notification area, and its Showballoontip method is used to consistently display the time specified by a balloon tip with the specified title, problem, and icon in the taskbar, with the syntax of the method as follows:1 /** * * The Showballontip method syntax for the Nontifyicon control is as follows: "3 * void Nontifyicon.showballontip (int timeout,string tiptitle, String ti Ptext, Tolltipicon Tipicon); 4 * Parameters and Description: 5 * Timeout: Indicates the length of time the balloon tip is displayed 6 * Tiptitlt: Indicates the caption 7 * TipText displayed on balloon tip: Indicates the Text 8 * Tipicon: Icon representing balloon tip 9 **/"Design Process" (1) Open visual Studio and create a new WinForm application named Bubbleshowform, (2the form layout is shown above. (3The key code is as follows:1 //click "Prompt" 2 Private voidBtn_show_click (Objectsender, EventArgs e)3 { 4         This. notifyicon.visible =true;//set hint control visible 5        //Show Bubble Tip, time is 1 seconds, content is current time, icon is message icon 6         This. Notifyicon.showballoontip ( +,"Current Time:", DateTime.Now.ToLocalTime (). ToString (), tooltipicon.info); 7 } 8  9 //Click "Close"Ten Private voidBtn_close_click (Objectsender, EventArgs e) One { A         This. notifyicon.visible =false;//set hint control hide -} Oh, a small function just, the key code above has been affixed, if you need attachments can message mailbox. 

WinForms Implement bubble Prompt window (reprint)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.