Pointer cursors4/1/2024 ' When the Radiobox changes, a new cursor type is set Mouse.OverrideCursor = DisplayArea.Cursor Use OverrideCursor to force the cursor for all elements If the cursor scope is set to the entire application Switch (())ĭisplayArea.Cursor = Cursors.AppStarting Changing the cursor of the Border control private void CursorTypeChanged(object sender, SelectionChangedEventArgs e)ĬomboBoxItem selectedCursor = source.SelectedItem as ComboBoxItem This forces the cursor to change for the whole application. If the cursor change is set to "Entire Application", the OverrideCursor property is set to the Cursor property of the Border control. A switch statement filters on the cursor name and sets the Cursor property on the Border which is named DisplayArea. The following code behind creates a SelectionChanged event handler which is called when the cursor type is changed in the ComboBox. The user interface is created, which consists of a ComboBox to select the desired Cursor, a pair of RadioButton objects to determine if the cursor change applies to only a single element or applies to the entire application, and a Border which is the element that the new cursor is applied to. This example consists of a Extensible Application Markup Language (XAML) file and a code behind file. This example shows how to change the Cursor of the mouse pointer for a specific element and for the application.
0 Comments
Leave a Reply.AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |