WinForms Implement Bubble Prompt window, winforms window

Source: Internet
Author: User

WinForms Implement Bubble Prompt window, winforms window

 

[Instance description]


Bubble prompts are received by most users because of their beautiful appearance. What users love is what programmers want to achieve.


This instance implements the taskbar bubble prompt to run this instance, as shown below:


Click the prompt and bubble prompt, and then click Close. The bubble disappears again.


[Key Technologies]


In this example, the ShowBallonTip method of the policyicon control is used.


The yyicon control is used to create a widget in the notification area. Its ShowBalloonTip method is used to continuously display the time specified by the balloon prompts with the specified title, question, and icon in the taskbar. The syntax format of this method is as follows:

1/** 2 * [the ShowBallonTip method syntax of the NontifyIcon control is as follows:] 3 * void NontifyIcon. showBallonTip (int timeout, string tipTitle, string tipText, TollTipIcon tipIcon); 4 * parameter and Description: 5 * timeout: the length of time the balloon prompt is displayed 6 * tipTitlt: title 7 * tipText: Text 8 * tipIcon: icon 9 **/The ShowBallonTip method syntax of the NontifyIcon Control

 

Design Process]
(1) Open Visual Studio, create a WinForm application, name it BubbleShowForm,
(2) The form layout is shown above.
(3) the key code is as follows:

1 // click "prompt" 2 private void btn_Show_Click (object sender, EventArgs e) 3 {4 this. policyicon. visible = true; // set the prompt control to be Visible. 5 // display the bubble prompt. The time is 1 second, the content is the current time, And the icon is the message icon 6 this. policyicon. showBalloonTip (1000, "current time:", DateTime. now. toLocalTime (). toString (), ToolTipIcon. info); 7} 8 9 // click "close" 10 private void btn_Close_Click (object sender, EventArgs e) 11 {12 this. policyicon. visible = false; // set the prompt to hide the control 13}Key code

 

Haha, it's only a small function. The key code has been attached to it. If you need an attachment, you can leave a message in your mailbox.

 

 

[From: [LonelyShadow blog] http://www.cnblogs.com/lonelyshadow]

 


How to change the bubble prompt in the taskbar window in mfc

This does not need to be implemented. It is the title of the window of your program. As long as there is a title (and it is very long) in your window, it will be displayed. This is not a procedural intervention.
Change the title of the main window.

VBNET implements bubble prompting

Dim toolTip1 As New ToolTip ()

ToolTip1.AutoPopDelay = 5000 ': The display stays for 5 seconds.

ToolTip1.InitialDelay = 1000 displayed after 1 second

ToolTip1.ReshowDelay = 100' is displayed after 500 seconds from one control to another.

ToolTip1.ShowAlways = true' is displayed when the window is not active

ToolTip1.SetToolTip (TextBox1, "prompt content ")

For details, see hi.baidu.com/...1.html.

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.