Mouse.OverrideCursor 속성

정의

전체 애플리케이션에 대한 커서를 가져오거나 설정합니다.

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발생시킨 컨트롤이 인 경우 커서 변경의 scope 나타내는 플래그가 설정되고 OverrideCursor 로 설정null됩니다. 이벤트를 rbScopeApplicationRadioButton발생시킨 컨트롤이 이면 커서 변경의 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

설명

합니다 CursorOverrideCursor 은 전체 애플리케이션에 적용 됩니다.

재정Cursor의를 지우려면 를 로 null설정합니다OverrideCursor.

를 로 None 설정 OverrideCursor 하면 마우스 커서가 표시되지 않지만 마우스 이벤트는 여전히 처리됩니다.

적용 대상