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 단일 요소 및 전체 애플리케이션 간에 커서 변경의 범위를 설정/해제 하는 데 사용 되는 합니다. 이벤트를 rbScopeElement
RadioButton발생시킨 컨트롤이 인 경우 커서 변경의 scope 나타내는 플래그가 설정되고 OverrideCursor 로 설정null
됩니다. 이벤트를 rbScopeApplication
RadioButton발생시킨 컨트롤이 이면 커서 변경의 scope 나타내는 플래그가 설정되고 OverrideCursor 라는 DisplayArea
컨트롤의 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
설명
합니다 Cursor 는 OverrideCursor 은 전체 애플리케이션에 적용 됩니다.
재정Cursor의를 지우려면 를 로 null
설정합니다OverrideCursor.
를 로 None 설정 OverrideCursor 하면 마우스 커서가 표시되지 않지만 마우스 이벤트는 여전히 처리됩니다.
적용 대상
.NET
피드백
https://aka.ms/ContentUserFeedback
출시 예정: 2024년 내내 콘텐츠에 대한 피드백 메커니즘으로 GitHub 문제를 단계적으로 폐지하고 이를 새로운 피드백 시스템으로 바꿀 예정입니다. 자세한 내용은 다음을 참조하세요.다음에 대한 사용자 의견 제출 및 보기