Button.MouseHover : Button « System.Windows.Forms « VB.Net by API






Button.MouseHover

  


    
Option Strict On
imports System
imports System.Drawing
imports System.Windows.Forms

public class MouseEnterHoverLeave : inherits Form

  private btn as Button

  public sub New()
    Size = new Size(400,400)

    btn = new Button()
    btn.Parent = me
    btn.Location = new Point(50,50)
    btn.Size = new Size(150,25)
    AddHandler btn.MouseEnter, AddressOf btn_MouseEnter
    AddHandler btn.MouseHover, AddressOf btn_MouseHover
    AddHandler btn.MouseLeave, AddressOf btn_MouseLeave
  end sub

  public shared sub Main() 
    Application.Run(new MouseEnterHoverLeave())
  end sub

  private sub btn_MouseEnter(ByVal sender as object,ByVal e as EventArgs)
    btn.Text = "MouseEnter"
    Console.WriteLine("Button MouseEnter")
  end sub

  private sub btn_MouseHover(ByVal sender as object,ByVal e as EventArgs)
    btn.Text = "MouseHover"
    Console.WriteLine("Button MouseHover")
  end sub

  private sub btn_MouseLeave(ByVal sender as object,ByVal e as EventArgs)
    btn.Text = "MouseLeave"
    Console.WriteLine("Button MouseLeave")
  end sub

  protected overrides sub OnMouseEnter(ByVal e as EventArgs)
    myBase.OnMouseEnter(e)
    Console.WriteLine("Form MouseEnter")
  end sub

  protected overrides sub OnMouseHover(ByVal e as EventArgs)
    myBase.OnMouseHover(e)
    Console.WriteLine("Form MouseHover")
  end sub

  protected overrides sub OnMouseLeave(ByVal e as EventArgs)
    myBase.OnMouseLeave(e)
    Console.WriteLine("Form MouseLeave")
  end sub
end class

   
    
  








Related examples in the same category

1.Button.Anchor
2.Button.BackColor
3.Button.Click
4.Button.FlatStyle
5.Button.HasChildren
6.Button.Image
7.Button.ImageAlign
8.Button.ImageIndex
9.Button.ImageList
10.Button.LostFocus
11.Button.MouseDown
12.Button.MouseEnter
13.Button.MouseLeave
14.Button.MouseUp
15.Button.Paint
16.Button.Parent
17.Button.PerformClick
18.Button.Region
19.Button.Text
20.Button.TextAlign
21.Button.TopLevelControl
22.Button.UseVisualStyleBackColor