Improving Your Desktop Applications With ToolTips in .NET MAUI

.NET 7 brings exciting features to .NET MAUI desktop development. Today, let’s look at ToolTips.


This content originally appeared on Telerik Blogs and was authored by Leomaris Reyes

.NET 7 brings exciting features to .NET MAUI desktop development. Today, let’s look at ToolTips.

Guess what? .NET 7 has been released! This has brought with it a series of super useful new features, which are very easy to implement and add to your .NET MAUI applications!

In this article we will focus on the new API to add ToolTips—which we can take great advantage of when developing desktop applications in .NET MAUI!

What Is a ToolTip?

A ToolTip is a visual aid feature which displays information, generally to instruct the user on how to use a particular control on the screen. This information can be viewed when placing the cursor on any element contained in the UI of your application.

How Do ToolTips Work?

To continue improving the user experience in desktop applications, .NET MAUI has added the ToolTip API. This allows us to associate a small description to a specific control, which the user can view in a small rectangle popup window when hovering the mouse pointer over the associated control.

ToolTip Implementation Structure

Tooltip structure: 1: ‘YourControl’, 2: ‘ToolTipProperties.Text’, 3: Tooltip message here.’

It’s a very simple implementation. You only have to take into account the three parts indicated in the image above for its correct operation. We are going to understand each one of them:

<YourControl ToolTipProperties.Text ="Tooltip message here."/>
  1. YourControl: This is a tag which starts the declaration of the control in which you want to add your ToolTip. It can be whatever you need (e.g., entry, button, whatever you want).

  2. ToolTipProperties.Text: With this you indicate that you want to add a ToolTip.

  3. ToolTip message: Right there, add the text that you want to be displayed. This receives a string as a value.

Let’s Look at an Example

Don’t forget to create your project with support for .NET 7.

In Configure your new .NET MAUI App screen, target framework should be .NET 7

Here I use the XAML that .NET MAUI creates for you by default when creating a new project. We will add an Entry to receive the Full name and in the ToolTips we will add a brief instruction of the expected value.

<Entry Placeholder="Full name"
   ToolTipProperties.Text="Your full name must have only letters."/>

And the result:

The field for full name shows tool tip ‘Your full name must have only letters’ when hovered

Conclusion

And done! From now on you know how to create ToolTips in your .NET MAUI apps!

See you next time! ‍♀️

References


This content originally appeared on Telerik Blogs and was authored by Leomaris Reyes


Print Share Comment Cite Upload Translate Updates
APA

Leomaris Reyes | Sciencx (2022-10-20T07:22:03+00:00) Improving Your Desktop Applications With ToolTips in .NET MAUI. Retrieved from https://www.scien.cx/2022/10/20/improving-your-desktop-applications-with-tooltips-in-net-maui/

MLA
" » Improving Your Desktop Applications With ToolTips in .NET MAUI." Leomaris Reyes | Sciencx - Thursday October 20, 2022, https://www.scien.cx/2022/10/20/improving-your-desktop-applications-with-tooltips-in-net-maui/
HARVARD
Leomaris Reyes | Sciencx Thursday October 20, 2022 » Improving Your Desktop Applications With ToolTips in .NET MAUI., viewed ,<https://www.scien.cx/2022/10/20/improving-your-desktop-applications-with-tooltips-in-net-maui/>
VANCOUVER
Leomaris Reyes | Sciencx - » Improving Your Desktop Applications With ToolTips in .NET MAUI. [Internet]. [Accessed ]. Available from: https://www.scien.cx/2022/10/20/improving-your-desktop-applications-with-tooltips-in-net-maui/
CHICAGO
" » Improving Your Desktop Applications With ToolTips in .NET MAUI." Leomaris Reyes | Sciencx - Accessed . https://www.scien.cx/2022/10/20/improving-your-desktop-applications-with-tooltips-in-net-maui/
IEEE
" » Improving Your Desktop Applications With ToolTips in .NET MAUI." Leomaris Reyes | Sciencx [Online]. Available: https://www.scien.cx/2022/10/20/improving-your-desktop-applications-with-tooltips-in-net-maui/. [Accessed: ]
rf:citation
» Improving Your Desktop Applications With ToolTips in .NET MAUI | Leomaris Reyes | Sciencx | https://www.scien.cx/2022/10/20/improving-your-desktop-applications-with-tooltips-in-net-maui/ |

Please log in to upload a file.




There are no updates yet.
Click the Upload button above to add an update.

You must be logged in to translate posts. Please log in or register.