Mouse.OverrideCursor Özellik
Tanım
Önemli
Bazı bilgiler ürünün ön sürümüyle ilgilidir ve sürüm öncesinde önemli değişiklikler yapılmış olabilir. Burada verilen bilgilerle ilgili olarak Microsoft açık veya zımni hiçbir garanti vermez.
Uygulamanın tamamı için imleci alır veya ayarlar.
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
Özellik Değeri
Geçersiz kılma imleci veya null ayarlanmadıysa OverrideCursor .
Örnekler
Aşağıdaki örnekte, bir imleç değişikliğinin kapsamını tek bir öğeyle uygulamanın tamamı arasında değiştirmek için RadioButton kullanılan bir olay işleyicisi gösterilmektedir. Olayı tetikleyen denetim ise rbScopeElementRadioButton, imleç kapsamını belirten bir bayrak değişir ve OverrideCursor olarak nullayarlanır. Olayı tetikleyen denetim iserbScopeApplicationRadioButton, imleç değişikliğinin kapsamını belirten bir bayrak ayarlanır ve OverrideCursor adlı DisplayAreadenetimin Border özelliğine Cursor ayarlanır.
// 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
Açıklamalar
Cursor OverrideCursor olarak ayarlanmış olan, uygulamanın tamamına uygulanır.
Geçersiz kılmayı Cursortemizlemek için olarak nullayarlayınOverrideCursor.
ayarı OverrideCursorNone fare imlecini görüntülenmemeye zorlar, ancak fare olayları yine de işlenir.