Mouse.OverrideCursor Mouse.OverrideCursor Mouse.OverrideCursor Mouse.OverrideCursor Property

정의

전체 애플리케이션에 대한 커서를 가져오거나 설정합니다.Gets or sets the cursor for the entire application.

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; }
member this.OverrideCursor : System.Windows.Input.Cursor with get, set
Public Shared Property OverrideCursor As Cursor

속성 값

재정의 커서이며, OverrideCursor가 설정되어 있지 않으면 null입니다.The override cursor or null if the OverrideCursor is not set.

예제

다음 예제에서는 이벤트 처리기는 RadioButton 단일 요소 및 전체 애플리케이션 간에 커서 변경의 범위를 설정/해제 하는 데 사용 되는 합니다.The following example shows an event handler for a RadioButton that is used to toggle the scope of a cursor change between a single element and the entire application. 이벤트를 발생 시킨 컨트롤이 있으면 합니다 rbScopeElement RadioButton, 커서 변경의 범위를 나타내는 플래그를 설정 및 OverrideCursor 로 설정 되어 null입니다.If the control that raised the event is the rbScopeElementRadioButton, a flag that denotes the scope of the cursor change is set and OverrideCursor is set to null. 이벤트를 발생 시킨 컨트롤이 있으면를 rbScopeApplication RadioButton, 커서 변경의 범위를 나타내는 플래그가 설정 되어 및 OverrideCursor 로 설정 되어를 Cursor 속성을 Border 라는 컨트롤 DisplayArea.If the control that raised the event is the rbScopeApplicationRadioButton, a flag that denotes the scope of the cursor change is set and OverrideCursor is set to the Cursor property of the Border control named DisplayArea.

// 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 은 전체 애플리케이션에 적용 됩니다.The Cursor that OverrideCursor is set to will be applied to the whole application.

재정의 지우려면 Cursor로 설정 OverrideCursornull입니다.To clear the override Cursor, set OverrideCursor to null.

설정 OverrideCursorNone 를 강제로 마우스 커서가 표시 되지 않지만 마우스 이벤트는 계속 처리 합니다.Setting OverrideCursor to None will force the mouse cursor not to be displayed, but mouse events are still processed.

적용 대상