Description
The Visibility
property of the Mouse
class determines the visibility state of the mouse cursor. It can be set to different states to control when the cursor is visible. The Auto
state will only show the mouse when clickable UI elements are visible, providing a dynamic user interface experience.
Usage
To use the Mouse.Visibility
property, simply set it to one of the available MouseVisibility
states. This property is static, so it can be accessed directly through the Mouse
class without needing to instantiate an object.
Example
// Example of setting the mouse visibility to always visible
Mouse.Visibility = MouseVisibility.Visible;
// Example of setting the mouse visibility to auto
Mouse.Visibility = MouseVisibility.Auto;
// Example of setting the mouse visibility to hidden
Mouse.Visibility = MouseVisibility.Hidden;