Display Area OnlyEntire Appliation
//File:Window.xaml.vb
Imports System
Imports System.Windows
Imports System.Windows.Controls
Imports System.Windows.Media
Imports System.Windows.Input
Imports System.IO
Imports System.Collections
Namespace WpfApplication1
Public Partial Class Window1
Inherits Window
Private CustomCursor As Cursor
Public Sub New()
CustomCursor = New Cursor(Directory.GetCurrentDirectory() & Path.DirectorySeparatorChar & "CustomCursor.cur")
End Sub
Public Sub CursorTypeChanged(sender As Object, e As SelectionChangedEventArgs)
Dim source As ComboBox = TryCast(e.Source, ComboBox)
If source IsNot Nothing Then
Dim selectedCursor As ComboBoxItem = TryCast(source.SelectedItem, ComboBoxItem)
Select Case selectedCursor.Content.ToString()
Case "AppStarting"
DisplayArea.Cursor = Cursors.AppStarting
Exit Select
Case "ArrowCD"
DisplayArea.Cursor = Cursors.ArrowCD
Exit Select
Case Else
Exit Select
End Select
If cursorScopeElementOnly = False Then
Mouse.OverrideCursor = DisplayArea.Cursor
End If
End If
End Sub
Public Sub CursorScopeSelected(sender As Object, e As RoutedEventArgs)
Dim source As RadioButton = TryCast(e.Source, RadioButton)
If source IsNot Nothing Then
If source.Name = "rbScopeElement" Then
cursorScopeElementOnly = True
Mouse.OverrideCursor = Nothing
End If
If source.Name = "rbScopeApplication" Then
cursorScopeElementOnly = False
Mouse.OverrideCursor = DisplayArea.Cursor
End If
End If
End Sub
Public Sub OnLoaded(sender As Object, e As RoutedEventArgs)
DirectCast(CursorSelector.Items(0), ComboBoxItem).IsSelected = True
End Sub
Private cursorScopeElementOnly As Boolean = True
End Class
End Namespace