The use of the ToolTip control for UI optimization

Source: Internet
Author: User

When you use a computer, you may notice a phenomenon: Floating text appears next to the mouse when it points to a picture or kanji. in fact , this effect is used. NET implementation is simple and requires the use of the ToolTip control. The following is a brief introduction to the ToolTip and its simple usage.

   Introduction:

The tooltip is preceded by all the properties of the control and is replaced with a separate ToolTip control in vb.net. As a separate class, you can make it easier for the user to rewrite the ToolTip class.

   Common Properties of the ToolTip

(1) Active property: Gets or sets a value that indicates whether the ToolTip is currently active.
True if the ToolTip is currently active, otherwise false. The default is true.
You can create and assign multiple ToolTip components for a form, but setting the Active property to false affects only the current ToolTip.


(2) AutomaticDelay property: Gets or sets the automatic delay of the ToolTip.
The automatic delay (in milliseconds). The default value is 500.


(3) AutoPopDelay property: Gets or sets the time period at which the tooltip remains visible when the pointer remains stationary within the control with the specified ToolTip text.
In milliseconds, the default value is 5000.

(4) ReshowDelay properties: Gets or sets how long it must take for the mouse pointer to move from one control to another to appear after the ToolTip window. in milliseconds.

(5) Showalways property: Gets or sets a value that indicates whether the ToolTip window is displayed, even when its parent control is inactive.
True if the ToolTip is always displayed, otherwise false. The default is False.

(6) BackColor properties: Gets or sets the background color of the ToolTip.

(7) ForeColor properties: Gets or sets the foreground color of the ToolTip. Use the BackColor and ForeColor properties to modify the color scheme used by the ToolTip. system default fonts are automatically used and can only be overridden by drawing tooltips on their own.

(8) IsBalloon property: Gets or sets a value that indicates whether the ToolTip should use a balloon window.
True if a balloon window should be used, or false if the standard rectangle window should be used. The default is False.

    common methods of tooltip

(1) GetToolTip method: Gets the ToolTip text associated with the specified control. To use: Str=tooltip1.gettooltip (Control)


(2) SetToolTip method: To make the ToolTip text associated with the specified control, we can use it to change the ToolTip text of the same control multiple times, using the following example to modify the ToolTip text of the Button1 button to "ToolTip text" : Tooltip1.settooltip (Button1, "tooltip text")


(3) RemoveAll method: Removes all ToolTip text that is currently associated with the ToolTip control.

Well, say so much, here's an example to show you once:

1. First add the ToolTip control on the form, and all controls on the form will have one more ToolTip property.

2. Edit the text to display in the tooltip of a control.

3. Set the properties for the display text in the ToolTip.

With these steps, we will complete the function of floating text. Look at the results of the operation:

    Summary:

The simple steps not only make our UI interface "tall", but also embody the idea of serving the whole world wholeheartedly. There's a lot more to optimize the UI interface, and we need to learn more. In short, in the study, we have to hold a thought: "Not will be found the source of power"!

Use of the ToolTip control for UI optimization

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.