Поделиться через


Shape.MouseEnter - событие

Происходит, когда указатель мыши входит в форму.

Пространство имен:  Microsoft.VisualBasic.PowerPacks
Сборка:  Microsoft.VisualBasic.PowerPacks.Vs (в Microsoft.VisualBasic.PowerPacks.Vs.dll)

Синтаксис

'Декларация
<BrowsableAttribute(True)> _
Public Event MouseEnter As EventHandler
[BrowsableAttribute(true)]
public event EventHandler MouseEnter
[BrowsableAttribute(true)]
public:
 event EventHandler^ MouseEnter {
    void add (EventHandler^ value);
    void remove (EventHandler^ value);
}
[<BrowsableAttribute(true)>]
member MouseEnter : IEvent<EventHandler,
    EventArgs>
JScript не поддерживает события.

Заметки

События мыши происходят в следующем порядке.

MouseEnter

MouseMove

MouseHover / MouseDown / MouseWheel

MouseUp

MouseLeave

Дополнительные сведения об обработке событий см. в разделе Прием событий.

Примеры

Следующий пример отображает сообщение в строке состояния, когда указатель мыши перемещается над формой.В этом примере необходима a RectangleShape мониторинг и именованные RectangleShape1 a StatusStrip наблюдение за StatusStrip1 с именем в форме.StatusStrip иметь a ToolStripStatusLabel именованное ToolStripStatusLabel1.

Private Sub RectangleShape1_MouseEnter(
  ) Handles RectangleShape1.MouseEnter

    ToolStripStatusLabel1.Text = "The mouse has entered the shape."
End Sub

Private Sub RectangleShape1_MouseHover(
  ) Handles RectangleShape1.MouseHover

    ToolStripStatusLabel1.Text = "The mouse is paused over the shape."
End Sub

Private Sub RectangleShape1_MouseLeave(
  ) Handles RectangleShape1.MouseLeave

    ToolStripStatusLabel1.Text = "The mouse has left the shape."
End Sub

Private Sub RectangleShape1_MouseMove(
  ) Handles RectangleShape1.MouseMove

    ToolStripStatusLabel1.Text = "The mouse is over the shape."
End Sub
private void rectangleShape1_MouseEnter(object sender, System.EventArgs e)
{
    toolStripStatusLabel1.Text = "The mouse has entered the shape.";
}

private void rectangleShape1_MouseHover(object sender, System.EventArgs e)
{
    toolStripStatusLabel1.Text = "The mouse is paused over the shape.";
}

private void rectangleShape1_MouseLeave(object sender, System.EventArgs e)
{
    toolStripStatusLabel1.Text = "The mouse has left the shape.";
}

private void rectangleShape1_MouseMove(object sender, 
    System.Windows.Forms.MouseEventArgs e)
{
    toolStripStatusLabel1.Text = "The mouse is over the shape.";
}

Безопасность платформы .NET Framework

См. также

Ссылки

Shape Класс

Microsoft.VisualBasic.PowerPacks - пространство имен

Другие ресурсы

Пошаговое руководство. Изображение линий при помощи элемента управления LineShape (Visual Studio)

Пошаговое руководство. Рисование фигур при помощи элементов управления OvalShape и RectangleShape (Visual Studio)

Знакомство с элементами управления Line и Shape (Visual Studio)