Mouse.OverrideCursor 속성
정의
중요
일부 정보는 릴리스되기 전에 상당 부분 수정될 수 있는 시험판 제품과 관련이 있습니다. Microsoft는 여기에 제공된 정보에 대해 어떠한 명시적이거나 묵시적인 보증도 하지 않습니다.
전체 애플리케이션에 대한 커서를 가져오거나 설정합니다.
public:
static property System::Windows::Input::Cursor ^ OverrideCursor { System::Windows::Input::Cursor ^ get(); void set(System::Windows::Input::Cursor ^ value); };
public static System.Windows.Input.Cursor OverrideCursor { get; set; }
static member OverrideCursor : System.Windows.Input.Cursor with get, set
Public Shared Property OverrideCursor As Cursor
속성 값
재정의 커서이거나 OverrideCursor 설정되지 않은 경우 null.
예제
다음 예제에서는 단일 요소와 전체 애플리케이션 간의 커서 변경 범위를 토글하는 데 사용되는 RadioButton 대한 이벤트 처리기를 보여 줍니다. 이벤트를 발생시킨 컨트롤이 rbScopeElementRadioButton경우 커서 변경의 범위를 나타내는 플래그가 설정되고 OverrideCursornull. 이벤트를 발생시킨 컨트롤이 rbScopeApplicationRadioButton경우 커서 변경 범위를 나타내는 플래그가 설정되고 OverrideCursorDisplayArea명명된 Border 컨트롤의 Cursor 속성으로 설정됩니다.
// Determines the scope the new cursor will have.
//
// If the RadioButton rbScopeElement is selected, then the cursor
// will only change on the display element.
//
// If the Radiobutton rbScopeApplication is selected, then the cursor
// will be changed for the entire application
//
private void CursorScopeSelected(object sender, RoutedEventArgs e)
{
RadioButton source = e.Source as RadioButton;
if (source != null)
{
if (source.Name == "rbScopeElement")
{
// Setting the element only scope flag to true
cursorScopeElementOnly = true;
// Clearing out the OverrideCursor.
Mouse.OverrideCursor = null;
}
if (source.Name == "rbScopeApplication")
{
// Setting the element only scope flag to false
cursorScopeElementOnly = false;
// Forcing the cursor for all elements.
Mouse.OverrideCursor = DisplayArea.Cursor;
}
}
}
' Determines the scope the new cursor will have.
'
' If the RadioButton rbScopeElement is selected, then the cursor
' will only change on the display element.
'
' If the Radiobutton rbScopeApplication is selected, then the cursor
' will be changed for the entire application.
'
Private Sub CursorScopeSelected(ByVal sender As Object, ByVal e As RoutedEventArgs)
Dim source As RadioButton = CType(e.Source, RadioButton)
If (source.Name = "rbScopeElement") Then
' Setting the element only scope flag to true.
cursorScopeElementOnly = True
' Clearing out the OverrideCursor.
Mouse.OverrideCursor = Nothing
End If
If (source.Name = "rbScopeApplication") Then
' Setting the element only scope flag to false.
cursorScopeElementOnly = False
' Forcing the cursor for all elements.
Mouse.OverrideCursor = DisplayArea.Cursor
End If
End Sub
설명
OverrideCursor 설정된 Cursor 전체 애플리케이션에 적용됩니다.
재정의 Cursor지우려면 OverrideCursornull설정합니다.
OverrideCursor None 설정하면 마우스 커서가 표시되지 않지만 마우스 이벤트는 여전히 처리됩니다.