<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="ru">
		<id>http://www.vbex.ru/index.php?action=history&amp;feed=atom&amp;title=VB.Net_Tutorial%2FEvent%2FMouse_Event</id>
		<title>VB.Net Tutorial/Event/Mouse Event - История изменений</title>
		<link rel="self" type="application/atom+xml" href="http://www.vbex.ru/index.php?action=history&amp;feed=atom&amp;title=VB.Net_Tutorial%2FEvent%2FMouse_Event"/>
		<link rel="alternate" type="text/html" href="http://www.vbex.ru/index.php?title=VB.Net_Tutorial/Event/Mouse_Event&amp;action=history"/>
		<updated>2026-04-05T08:05:29Z</updated>
		<subtitle>История изменений этой страницы в вики</subtitle>
		<generator>MediaWiki 1.30.0</generator>

	<entry>
		<id>http://www.vbex.ru/index.php?title=VB.Net_Tutorial/Event/Mouse_Event&amp;diff=3047&amp;oldid=prev</id>
		<title> в 16:40, 26 мая 2010</title>
		<link rel="alternate" type="text/html" href="http://www.vbex.ru/index.php?title=VB.Net_Tutorial/Event/Mouse_Event&amp;diff=3047&amp;oldid=prev"/>
				<updated>2010-05-26T16:40:30Z</updated>
		
		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left&quot; data-mw=&quot;interface&quot;&gt;
				&lt;tr style=&quot;vertical-align: top;&quot; lang=&quot;ru&quot;&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;← Предыдущая&lt;/td&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;Версия 16:40, 26 мая 2010&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; style=&quot;text-align: center;&quot; lang=&quot;ru&quot;&gt;&lt;div class=&quot;mw-diff-empty&quot;&gt;(нет различий)&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;</summary>
			</entry>

	<entry>
		<id>http://www.vbex.ru/index.php?title=VB.Net_Tutorial/Event/Mouse_Event&amp;diff=3048&amp;oldid=prev</id>
		<title>Admin: 1 версия</title>
		<link rel="alternate" type="text/html" href="http://www.vbex.ru/index.php?title=VB.Net_Tutorial/Event/Mouse_Event&amp;diff=3048&amp;oldid=prev"/>
				<updated>2010-05-26T12:54:06Z</updated>
		
		<summary type="html">&lt;p&gt;1 версия&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Новая страница&lt;/b&gt;&lt;/p&gt;&lt;div&gt;==Double and single click==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
&amp;lt;source lang=&amp;quot;vbnet&amp;quot;&amp;gt;Imports System.Drawing&lt;br /&gt;
Imports System.Drawing.Drawing2D&lt;br /&gt;
Imports System.Windows.Forms&lt;br /&gt;
public class PictureBoxSingleDoubleClicked&lt;br /&gt;
   public Shared Sub Main&lt;br /&gt;
        Application.Run(New Form1)&lt;br /&gt;
   End Sub&lt;br /&gt;
End class&lt;br /&gt;
Public Class Form1&lt;br /&gt;
    Private oldcolor As Color&lt;br /&gt;
    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click&lt;br /&gt;
        PictureBox1.Image = System.Drawing.Image.FromFile(&amp;quot;yourfile.jpg&amp;quot;)&lt;br /&gt;
        Label1.Text = &amp;quot;Loaded&amp;quot;&lt;br /&gt;
    End Sub&lt;br /&gt;
    Private Sub Button1_MouseDown(ByVal sender As System.Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles Button1.MouseDown&lt;br /&gt;
        If (e.Button &amp;lt;&amp;gt; MouseButtons.Left) Then&lt;br /&gt;
            Label1.Text = &amp;quot;Left button&amp;quot;&lt;br /&gt;
        End If&lt;br /&gt;
    End Sub&lt;br /&gt;
    Private Sub PictureBox1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles PictureBox1.Click&lt;br /&gt;
        Label1.Text = &amp;quot;single cliked&amp;quot;&lt;br /&gt;
    End Sub&lt;br /&gt;
    Private Sub PictureBox1_DoubleClick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles PictureBox1.DoubleClick&lt;br /&gt;
        Label1.Text = &amp;quot;double clicked&amp;quot;&lt;br /&gt;
    End Sub&lt;br /&gt;
    Private Sub PictureBox1_MouseMove(ByVal sender As System.Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles PictureBox1.MouseMove&lt;br /&gt;
        PictureBox1.BackColor = System.Drawing.Color.Gray&lt;br /&gt;
        PictureBox1.Image = System.Drawing.Image.FromFile(&amp;quot;yourfile.jpg&amp;quot;)&lt;br /&gt;
        Label1.Text = &amp;quot;(&amp;quot; + Str(e.X) + &amp;quot;,&amp;quot; + Str(e.Y) + &amp;quot;)&amp;quot;&lt;br /&gt;
    End Sub&lt;br /&gt;
    Private Sub PictureBox1_MouseLeave(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles PictureBox1.MouseLeave&lt;br /&gt;
        PictureBox1.BackColor = oldcolor&lt;br /&gt;
        PictureBox1.Image = System.Drawing.Image.FromFile(&amp;quot;yourfile.jpg&amp;quot;)&lt;br /&gt;
        Label1.Text = &amp;quot;Exit&amp;quot;&lt;br /&gt;
    End Sub&lt;br /&gt;
    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load&lt;br /&gt;
        oldcolor = PictureBox1.BackColor&lt;br /&gt;
    End Sub&lt;br /&gt;
End Class&lt;br /&gt;
&lt;br /&gt;
&amp;lt;Global.Microsoft.VisualBasic.rupilerServices.DesignerGenerated()&amp;gt; _&lt;br /&gt;
Partial Class Form1&lt;br /&gt;
    Inherits System.Windows.Forms.Form&lt;br /&gt;
    &amp;quot;Form overrides dispose to clean up the component list.&lt;br /&gt;
    &amp;lt;System.Diagnostics.DebuggerNonUserCode()&amp;gt; _&lt;br /&gt;
    Protected Overrides Sub Dispose(ByVal disposing As Boolean)&lt;br /&gt;
        If disposing AndAlso components IsNot Nothing Then&lt;br /&gt;
            components.Dispose()&lt;br /&gt;
        End If&lt;br /&gt;
        MyBase.Dispose(disposing)&lt;br /&gt;
    End Sub&lt;br /&gt;
    &amp;quot;Required by the Windows Form Designer&lt;br /&gt;
    Private components As System.ruponentModel.IContainer&lt;br /&gt;
    &amp;quot;NOTE: The following procedure is required by the Windows Form Designer&lt;br /&gt;
    &amp;quot;It can be modified using the Windows Form Designer.  &lt;br /&gt;
    &amp;quot;Do not modify it using the code editor.&lt;br /&gt;
    &amp;lt;System.Diagnostics.DebuggerStepThrough()&amp;gt; _&lt;br /&gt;
    Private Sub InitializeComponent()&lt;br /&gt;
        Me.Button1 = New System.Windows.Forms.Button&lt;br /&gt;
        Me.Label1 = New System.Windows.Forms.Label&lt;br /&gt;
        Me.PictureBox1 = New System.Windows.Forms.PictureBox&lt;br /&gt;
        CType(Me.PictureBox1, System.ruponentModel.ISupportInitialize).BeginInit()&lt;br /&gt;
        Me.SuspendLayout()&lt;br /&gt;
        &amp;quot;&lt;br /&gt;
        &amp;quot;Button1&lt;br /&gt;
        &amp;quot;&lt;br /&gt;
        Me.Button1.Location = New System.Drawing.Point(181, 231)&lt;br /&gt;
        Me.Button1.Name = &amp;quot;Button1&amp;quot;&lt;br /&gt;
        Me.Button1.Size = New System.Drawing.Size(75, 23)&lt;br /&gt;
        Me.Button1.TabIndex = 0&lt;br /&gt;
        Me.Button1.Text = &amp;quot;load pic&amp;quot;&lt;br /&gt;
        Me.Button1.UseVisualStyleBackColor = True&lt;br /&gt;
        &amp;quot;&lt;br /&gt;
        &amp;quot;Label1&lt;br /&gt;
        &amp;quot;&lt;br /&gt;
        Me.Label1.AutoSize = True&lt;br /&gt;
        Me.Label1.Location = New System.Drawing.Point(28, 9)&lt;br /&gt;
        Me.Label1.Name = &amp;quot;Label1&amp;quot;&lt;br /&gt;
        Me.Label1.Size = New System.Drawing.Size(41, 12)&lt;br /&gt;
        Me.Label1.TabIndex = 1&lt;br /&gt;
        Me.Label1.Text = &amp;quot;Label1&amp;quot;&lt;br /&gt;
        &amp;quot;&lt;br /&gt;
        &amp;quot;PictureBox1&lt;br /&gt;
        &amp;quot;&lt;br /&gt;
        Me.PictureBox1.Location = New System.Drawing.Point(20, 30)&lt;br /&gt;
        Me.PictureBox1.Name = &amp;quot;PictureBox1&amp;quot;&lt;br /&gt;
        Me.PictureBox1.Size = New System.Drawing.Size(391, 189)&lt;br /&gt;
        Me.PictureBox1.TabIndex = 2&lt;br /&gt;
        Me.PictureBox1.TabStop = False&lt;br /&gt;
        &amp;quot;&lt;br /&gt;
        &amp;quot;Form1&lt;br /&gt;
        &amp;quot;&lt;br /&gt;
        Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 12.0!)&lt;br /&gt;
        Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font&lt;br /&gt;
        Me.ClientSize = New System.Drawing.Size(431, 266)&lt;br /&gt;
        Me.Controls.Add(Me.PictureBox1)&lt;br /&gt;
        Me.Controls.Add(Me.Label1)&lt;br /&gt;
        Me.Controls.Add(Me.Button1)&lt;br /&gt;
        Me.Name = &amp;quot;Form1&amp;quot;&lt;br /&gt;
        Me.Text = &amp;quot;Form1&amp;quot;&lt;br /&gt;
        CType(Me.PictureBox1, System.ruponentModel.ISupportInitialize).EndInit()&lt;br /&gt;
        Me.ResumeLayout(False)&lt;br /&gt;
        Me.PerformLayout()&lt;br /&gt;
    End Sub&lt;br /&gt;
    Friend WithEvents Button1 As System.Windows.Forms.Button&lt;br /&gt;
    Friend WithEvents Label1 As System.Windows.Forms.Label&lt;br /&gt;
    Friend WithEvents PictureBox1 As System.Windows.Forms.PictureBox&lt;br /&gt;
End Class&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Form mouse move event==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
&amp;lt;source lang=&amp;quot;vbnet&amp;quot;&amp;gt;Imports System.Drawing&lt;br /&gt;
Imports System.Drawing.Drawing2D&lt;br /&gt;
Imports System.Windows.Forms&lt;br /&gt;
public class FormRefresh&lt;br /&gt;
   public Shared Sub Main&lt;br /&gt;
        Application.Run(New Form1)&lt;br /&gt;
   End Sub&lt;br /&gt;
End class&lt;br /&gt;
Public Class Form1&lt;br /&gt;
    Private MouseX As Integer&lt;br /&gt;
    Private MouseY As Integer&lt;br /&gt;
    Dim rectangle1 As Rectangle = New Rectangle(15, 35, 80, 80)&lt;br /&gt;
    Private Sub Form1_MouseMove(ByVal sender As Object, _&lt;br /&gt;
          ByVal e As System.Windows.Forms.MouseEventArgs) _&lt;br /&gt;
          Handles Me.MouseMove&lt;br /&gt;
        MouseX = e.X&lt;br /&gt;
        MouseY = e.Y&lt;br /&gt;
        Me.Invalidate()&lt;br /&gt;
    End Sub&lt;br /&gt;
    Private Sub Form1_Paint(ByVal sender As Object, _&lt;br /&gt;
          ByVal e As System.Windows.Forms.PaintEventArgs) _&lt;br /&gt;
          Handles Me.Paint&lt;br /&gt;
          &lt;br /&gt;
          rectangle1.X = MouseX&lt;br /&gt;
          rectangle1.Y = MouseY&lt;br /&gt;
        Dim canvas As Graphics = e.Graphics  &lt;br /&gt;
        canvas.DrawRectangle(Pens.DarkRed, rectangle1)&lt;br /&gt;
    End Sub&lt;br /&gt;
End Class&lt;br /&gt;
&lt;br /&gt;
&amp;lt;Global.Microsoft.VisualBasic.rupilerServices.DesignerGenerated()&amp;gt; _&lt;br /&gt;
Partial Class Form1&lt;br /&gt;
    Inherits System.Windows.Forms.Form&lt;br /&gt;
    &amp;quot;Form overrides dispose to clean up the component list.&lt;br /&gt;
    &amp;lt;System.Diagnostics.DebuggerNonUserCode()&amp;gt; _&lt;br /&gt;
    Protected Overrides Sub Dispose(ByVal disposing As Boolean)&lt;br /&gt;
        If disposing AndAlso components IsNot Nothing Then&lt;br /&gt;
            components.Dispose()&lt;br /&gt;
        End If&lt;br /&gt;
        MyBase.Dispose(disposing)&lt;br /&gt;
    End Sub&lt;br /&gt;
    &amp;quot;Required by the Windows Form Designer&lt;br /&gt;
    Private components As System.ruponentModel.IContainer&lt;br /&gt;
    &amp;quot;NOTE: The following procedure is required by the Windows Form Designer&lt;br /&gt;
    &amp;quot;It can be modified using the Windows Form Designer.  &lt;br /&gt;
    &amp;quot;Do not modify it using the code editor.&lt;br /&gt;
    &amp;lt;System.Diagnostics.DebuggerStepThrough()&amp;gt; _&lt;br /&gt;
    Private Sub InitializeComponent()&lt;br /&gt;
        Me.SuspendLayout()&lt;br /&gt;
        &amp;quot;&lt;br /&gt;
        &amp;quot;Form1&lt;br /&gt;
        &amp;quot;&lt;br /&gt;
        Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)&lt;br /&gt;
        Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font&lt;br /&gt;
        Me.ClientSize = New System.Drawing.Size(469, 387)&lt;br /&gt;
        Me.Name = &amp;quot;Form1&amp;quot;&lt;br /&gt;
        Me.Text = &amp;quot;Redrawing by Invalidating&amp;quot;&lt;br /&gt;
        Me.ResumeLayout(False)&lt;br /&gt;
    End Sub&lt;br /&gt;
End Class&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Mouse Enter and Leave==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
&amp;lt;source lang=&amp;quot;vbnet&amp;quot;&amp;gt;Imports System.Drawing&lt;br /&gt;
Imports System.Drawing.Drawing2D&lt;br /&gt;
Imports System.Windows.Forms&lt;br /&gt;
public class MouseEnterLeave&lt;br /&gt;
   public Shared Sub Main&lt;br /&gt;
        Application.Run(New Form1)&lt;br /&gt;
   End Sub&lt;br /&gt;
End class&lt;br /&gt;
Public Class Form1&lt;br /&gt;
    Private ButtonBackColor As Color = Color.LightGreen&lt;br /&gt;
    Private Sub Button2_MouseEnter(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button2.MouseEnter&lt;br /&gt;
        ButtonBackColor = Color.Yellow&lt;br /&gt;
    End Sub&lt;br /&gt;
    Private Sub Button2_MouseLeave(ByVal sender As Object,ByVal e As System.EventArgs) Handles Button2.MouseLeave&lt;br /&gt;
        ButtonBackColor = Color.Red&lt;br /&gt;
    End Sub&lt;br /&gt;
    Private Sub Button2_MouseDown(ByVal sender As Object,ByVal e As System.Windows.Forms.MouseEventArgs) Handles Button2.MouseDown&lt;br /&gt;
        ButtonBackColor = Color.Green&lt;br /&gt;
    End Sub&lt;br /&gt;
    Private Sub Button2_MouseUp(ByVal sender As Object,ByVal e As System.Windows.Forms.MouseEventArgs) Handles Button2.MouseUp&lt;br /&gt;
        ButtonBackColor = Color.LightGreen&lt;br /&gt;
        Button2.Refresh()&lt;br /&gt;
    End Sub&lt;br /&gt;
    Private Sub Button2_Paint(ByVal sender As Object, ByVal e As System.Windows.Forms.PaintEventArgs) Handles Button2.Paint&lt;br /&gt;
        Dim canvas As Graphics = e.Graphics&lt;br /&gt;
        canvas.Clear(ButtonBackColor)&lt;br /&gt;
        Dim atomPen As Pen = New Pen(Color.Blue, 2)&lt;br /&gt;
        Dim largerFont As Font = New Font(Me.Font.Name, 10)&lt;br /&gt;
        e.Graphics.DrawString(&amp;quot;This is a form&amp;quot;, largerFont, Brushes.Black,0, 20)&lt;br /&gt;
    End Sub&lt;br /&gt;
    Private Sub Button2_Click(ByVal sender As System.Object,ByVal e As System.EventArgs) Handles Button2.Click&lt;br /&gt;
        MsgBox(&amp;quot;Button2 clicked!&amp;quot;, MsgBoxStyle.Exclamation,&amp;quot;Painting on Controls&amp;quot;)&lt;br /&gt;
    End Sub&lt;br /&gt;
End Class&lt;br /&gt;
&lt;br /&gt;
&amp;lt;Global.Microsoft.VisualBasic.rupilerServices.DesignerGenerated()&amp;gt; _&lt;br /&gt;
Partial Class Form1&lt;br /&gt;
    Inherits System.Windows.Forms.Form&lt;br /&gt;
    &amp;quot;Form overrides dispose to clean up the component list.&lt;br /&gt;
    &amp;lt;System.Diagnostics.DebuggerNonUserCode()&amp;gt; _&lt;br /&gt;
    Protected Overrides Sub Dispose(ByVal disposing As Boolean)&lt;br /&gt;
        If disposing AndAlso components IsNot Nothing Then&lt;br /&gt;
            components.Dispose()&lt;br /&gt;
        End If&lt;br /&gt;
        MyBase.Dispose(disposing)&lt;br /&gt;
    End Sub&lt;br /&gt;
    &amp;quot;Required by the Windows Form Designer&lt;br /&gt;
    Private components As System.ruponentModel.IContainer&lt;br /&gt;
    &amp;quot;NOTE: The following procedure is required by the Windows Form Designer&lt;br /&gt;
    &amp;quot;It can be modified using the Windows Form Designer.  &lt;br /&gt;
    &amp;quot;Do not modify it using the code editor.&lt;br /&gt;
    &amp;lt;System.Diagnostics.DebuggerStepThrough()&amp;gt; _&lt;br /&gt;
    Private Sub InitializeComponent()&lt;br /&gt;
        Me.Panel1 = New System.Windows.Forms.Panel&lt;br /&gt;
        Me.Button2 = New System.Windows.Forms.Button&lt;br /&gt;
        Me.SuspendLayout()&lt;br /&gt;
        &amp;quot;&lt;br /&gt;
        &amp;quot;Panel1&lt;br /&gt;
        &amp;quot;&lt;br /&gt;
        Me.Panel1.Location = New System.Drawing.Point(56, 32)&lt;br /&gt;
        Me.Panel1.Name = &amp;quot;Panel1&amp;quot;&lt;br /&gt;
        Me.Panel1.Size = New System.Drawing.Size(368, 40)&lt;br /&gt;
        Me.Panel1.TabIndex = 0&lt;br /&gt;
        &amp;quot;&lt;br /&gt;
        &amp;quot;Button2&lt;br /&gt;
        &amp;quot;&lt;br /&gt;
        Me.Button2.Location = New System.Drawing.Point(272, 104)&lt;br /&gt;
        Me.Button2.Name = &amp;quot;Button2&amp;quot;&lt;br /&gt;
        Me.Button2.Size = New System.Drawing.Size(152, 152)&lt;br /&gt;
        Me.Button2.TabIndex = 1&lt;br /&gt;
        Me.Button2.Text = &amp;quot;Button2&amp;quot;&lt;br /&gt;
        Me.Button2.UseVisualStyleBackColor = True&lt;br /&gt;
        &amp;quot;&lt;br /&gt;
        &amp;quot;Form1&lt;br /&gt;
        &amp;quot;&lt;br /&gt;
        Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)&lt;br /&gt;
        Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font&lt;br /&gt;
        Me.ClientSize = New System.Drawing.Size(479, 284)&lt;br /&gt;
        Me.Controls.Add(Me.Button2)&lt;br /&gt;
        Me.Controls.Add(Me.Panel1)&lt;br /&gt;
        Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle&lt;br /&gt;
        Me.MaximizeBox = False&lt;br /&gt;
        Me.Text = &amp;quot;Special Effects&amp;quot;&lt;br /&gt;
        Me.ResumeLayout(False)&lt;br /&gt;
    End Sub&lt;br /&gt;
    Friend WithEvents Panel1 As System.Windows.Forms.Panel&lt;br /&gt;
    Friend WithEvents Button2 As System.Windows.Forms.Button&lt;br /&gt;
End Class&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Mouse Events Illustation==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
&amp;lt;source lang=&amp;quot;vbnet&amp;quot;&amp;gt;Option Strict On&lt;br /&gt;
imports System&lt;br /&gt;
imports System.Drawing&lt;br /&gt;
imports System.Windows.Forms&lt;br /&gt;
public class MouseEvents : inherits Form&lt;br /&gt;
  private lbl as Label&lt;br /&gt;
  private WithEvents btnReset as Button&lt;br /&gt;
  public sub New()&lt;br /&gt;
    Size = new Size(400,600)&lt;br /&gt;
    btnReset = new Button()&lt;br /&gt;
    btnReset.Parent = me&lt;br /&gt;
    btnReset.Location = new Point(250,50)&lt;br /&gt;
    btnReset.Text = &amp;quot;Reset&amp;quot;&lt;br /&gt;
    lbl = new Label()&lt;br /&gt;
    lbl.Parent = me&lt;br /&gt;
    lbl.Location = new Point(50,50)&lt;br /&gt;
    lbl.Size = new Size(250,250)&lt;br /&gt;
    lbl.BorderStyle = BorderStyle.Fixed3D&lt;br /&gt;
    &lt;br /&gt;
    AddHandler lbl.MouseEnter, AddressOf lbl_MouseEnter&lt;br /&gt;
    AddHandler lbl.MouseHover, AddressOf lbl_MouseHover&lt;br /&gt;
    AddHandler lbl.MouseLeave, AddressOf lbl_MouseLeave&lt;br /&gt;
    AddHandler lbl.MouseDown, AddressOf lbl_MouseDown&lt;br /&gt;
      AddHandler lbl.MouseMove, AddressOf lbl_MouseMove&lt;br /&gt;
    AddHandler lbl.MouseUp, AddressOf lbl_MouseUp&lt;br /&gt;
    AddHandler lbl.MouseWheel, AddressOf lbl_MouseWheel&lt;br /&gt;
    AddHandler lbl.Click, AddressOf lbl_Click&lt;br /&gt;
    AddHandler lbl.DoubleClick, AddressOf lbl_DoubleClick&lt;br /&gt;
  end sub&lt;br /&gt;
  public shared sub Main() &lt;br /&gt;
    Application.Run(new MouseEvents())&lt;br /&gt;
  end sub&lt;br /&gt;
  private sub btnReset_Click(ByVal sender as object, _&lt;br /&gt;
                 ByVal e as EventArgs) _&lt;br /&gt;
                   Handles btnReset.Click&lt;br /&gt;
    lbl.Text = &amp;quot;&amp;quot;&lt;br /&gt;
  end sub&lt;br /&gt;
  private sub lbl_MouseEnter(ByVal sender as object, _&lt;br /&gt;
                 ByVal e as EventArgs)&lt;br /&gt;
    lbl.Text = &amp;quot;MouseEnter&amp;quot;&lt;br /&gt;
    Console.WriteLine(&amp;quot;Label MouseEnter&amp;quot;)&lt;br /&gt;
  end sub&lt;br /&gt;
  private sub lbl_MouseHover(ByVal sender as object, _&lt;br /&gt;
                 ByVal e as EventArgs)&lt;br /&gt;
    lbl.Text = &amp;quot;MouseHover&amp;quot;&lt;br /&gt;
    Console.WriteLine(&amp;quot;Label MouseHover&amp;quot;)&lt;br /&gt;
  end sub&lt;br /&gt;
  private sub lbl_MouseLeave(ByVal sender as object, _&lt;br /&gt;
                 ByVal e as EventArgs)&lt;br /&gt;
    lbl.Text = &amp;quot;MouseLeave&amp;quot;&lt;br /&gt;
    Console.WriteLine(&amp;quot;Label MouseLeave&amp;quot;)&lt;br /&gt;
  end sub&lt;br /&gt;
  private sub lbl_MouseDown(ByVal sender as object, _&lt;br /&gt;
                ByVal e as MouseEventArgs)&lt;br /&gt;
    lbl.Text = &amp;quot;MouseDown&amp;quot;&lt;br /&gt;
    Console.WriteLine(&amp;quot;Label MouseDown&amp;quot;)&lt;br /&gt;
    Console.WriteLine(&amp;quot;Button:  &amp;quot; + e.Button.ToString())&lt;br /&gt;
    Console.WriteLine(&amp;quot;Clicks:  &amp;quot; + e.Clicks.ToString())&lt;br /&gt;
    Console.WriteLine(&amp;quot;Delta:  &amp;quot; + e.Delta.ToString())&lt;br /&gt;
    Console.WriteLine(&amp;quot;X:  &amp;quot; + e.X.ToString())&lt;br /&gt;
    Console.WriteLine(&amp;quot;Y:  &amp;quot; + e.Y.ToString())&lt;br /&gt;
  end sub&lt;br /&gt;
  private sub lbl_MouseMove(ByVal sender as object,ByVal e as MouseEventArgs)&lt;br /&gt;
    lbl.Text = &amp;quot;MouseMove&amp;quot;&lt;br /&gt;
    Console.WriteLine(&amp;quot;Label MouseMove&amp;quot;)&lt;br /&gt;
    Console.WriteLine(&amp;quot;Button:  &amp;quot; + e.Button.ToString())&lt;br /&gt;
    Console.WriteLine(&amp;quot;Clicks:  &amp;quot; + e.Clicks.ToString())&lt;br /&gt;
    Console.WriteLine(&amp;quot;Delta:  &amp;quot; + e.Delta.ToString())&lt;br /&gt;
    Console.WriteLine(&amp;quot;X:  &amp;quot; + e.X.ToString())&lt;br /&gt;
    Console.WriteLine(&amp;quot;Y:  &amp;quot; + e.Y.ToString())&lt;br /&gt;
  end sub&lt;br /&gt;
  private sub lbl_MouseUp(ByVal sender as object, _&lt;br /&gt;
                ByVal e as MouseEventArgs)&lt;br /&gt;
    lbl.Text = &amp;quot;MouseUp&amp;quot;&lt;br /&gt;
    Console.WriteLine(&amp;quot;Label MouseUp&amp;quot;)&lt;br /&gt;
    Console.WriteLine(&amp;quot;Button:  &amp;quot; + e.Button.ToString())&lt;br /&gt;
    Console.WriteLine(&amp;quot;Clicks:  &amp;quot; + e.Clicks.ToString())&lt;br /&gt;
    Console.WriteLine(&amp;quot;Delta:  &amp;quot; + e.Delta.ToString())&lt;br /&gt;
    Console.WriteLine(&amp;quot;X:  &amp;quot; + e.X.ToString())&lt;br /&gt;
    Console.WriteLine(&amp;quot;Y:  &amp;quot; + e.Y.ToString())&lt;br /&gt;
  end sub&lt;br /&gt;
  private sub lbl_MouseWheel(ByVal sender as object,ByVal e as MouseEventArgs)&lt;br /&gt;
    lbl.Text = &amp;quot;MouseWheel&amp;quot;&lt;br /&gt;
    Console.WriteLine(&amp;quot;Label MouseWheel&amp;quot;)&lt;br /&gt;
    Console.WriteLine(&amp;quot;Button:  &amp;quot; + e.Button.ToString())&lt;br /&gt;
    Console.WriteLine(&amp;quot;Clicks:  &amp;quot; + e.Clicks.ToString())&lt;br /&gt;
    Console.WriteLine(&amp;quot;Delta:  &amp;quot; + e.Delta.ToString())&lt;br /&gt;
    Console.WriteLine(&amp;quot;X:  &amp;quot; + e.X.ToString())&lt;br /&gt;
    Console.WriteLine(&amp;quot;Y:  &amp;quot; + e.Y.ToString())&lt;br /&gt;
  end sub&lt;br /&gt;
  private sub lbl_Click(ByVal sender as object,ByVal e as EventArgs)&lt;br /&gt;
    lbl.Text = &amp;quot;Click&amp;quot;&lt;br /&gt;
    Console.WriteLine(&amp;quot;Label Click&amp;quot;)&lt;br /&gt;
  end sub&lt;br /&gt;
  private sub lbl_DoubleClick(ByVal sender as object,ByVal e as EventArgs)&lt;br /&gt;
    lbl.Text = &amp;quot;DoubleClick&amp;quot;&lt;br /&gt;
    Console.WriteLine(&amp;quot;Label DoubleClick&amp;quot;)&lt;br /&gt;
  end sub&lt;br /&gt;
  protected overrides sub OnMouseEnter(ByVal e as EventArgs)&lt;br /&gt;
    myBase.OnMouseEnter(e)&lt;br /&gt;
    Console.WriteLine(&amp;quot;Form MouseEnter&amp;quot;)&lt;br /&gt;
  end sub&lt;br /&gt;
  protected overrides sub OnMouseHover(ByVal e as EventArgs)&lt;br /&gt;
    myBase.OnMouseHover(e)&lt;br /&gt;
    Console.WriteLine(&amp;quot;Form MouseHover&amp;quot;)&lt;br /&gt;
  end sub&lt;br /&gt;
  protected overrides sub OnMouseLeave(ByVal e as EventArgs)&lt;br /&gt;
    myBase.OnMouseLeave(e)&lt;br /&gt;
    Console.WriteLine(&amp;quot;Form MouseLeave&amp;quot;)&lt;br /&gt;
  end sub&lt;br /&gt;
end class&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Mouse move event==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
&amp;lt;source lang=&amp;quot;vbnet&amp;quot;&amp;gt;Imports System.Windows.Forms&lt;br /&gt;
public class MouseMoveEvent&lt;br /&gt;
   public Shared Sub Main&lt;br /&gt;
        Application.Run(New Form1)&lt;br /&gt;
   End Sub&lt;br /&gt;
End class&lt;br /&gt;
Public Class Form1&lt;br /&gt;
    Inherits System.Windows.Forms.Form&lt;br /&gt;
#Region &amp;quot; Windows Form Designer generated code &amp;quot;&lt;br /&gt;
    Public Sub New()&lt;br /&gt;
        MyBase.New()&lt;br /&gt;
        &amp;quot;This call is required by the Windows Form Designer.&lt;br /&gt;
        InitializeComponent()&lt;br /&gt;
        &amp;quot;Add any initialization after the InitializeComponent() call&lt;br /&gt;
    End Sub&lt;br /&gt;
    &amp;quot;Form overrides dispose to clean up the component list.&lt;br /&gt;
    Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)&lt;br /&gt;
        If disposing Then&lt;br /&gt;
            If Not (components Is Nothing) Then&lt;br /&gt;
                components.Dispose()&lt;br /&gt;
            End If&lt;br /&gt;
        End If&lt;br /&gt;
        MyBase.Dispose(disposing)&lt;br /&gt;
    End Sub&lt;br /&gt;
   &lt;br /&gt;
    Private WithEvents Label1 As System.Windows.Forms.Label&lt;br /&gt;
    Private WithEvents lblX As System.Windows.Forms.Label&lt;br /&gt;
    Private WithEvents Label3 As System.Windows.Forms.Label&lt;br /&gt;
    Private WithEvents lblY As System.Windows.Forms.Label&lt;br /&gt;
    &amp;quot;Required by the Windows Form Designer&lt;br /&gt;
    Private components As System.ruponentModel.Container&lt;br /&gt;
    &amp;quot;NOTE: The following procedure is required by the Windows Form Designer&lt;br /&gt;
    &amp;quot;It can be modified using the Windows Form Designer.  &lt;br /&gt;
    &amp;quot;Do not modify it using the code editor.&lt;br /&gt;
    &amp;lt;System.Diagnostics.DebuggerStepThroughAttribute()&amp;gt; Private Sub InitializeComponent()&lt;br /&gt;
        Me.Label1 = New System.Windows.Forms.Label()&lt;br /&gt;
        Me.Label3 = New System.Windows.Forms.Label()&lt;br /&gt;
        Me.lblX = New System.Windows.Forms.Label()&lt;br /&gt;
        Me.lblY = New System.Windows.Forms.Label()&lt;br /&gt;
        Me.SuspendLayout()&lt;br /&gt;
        &amp;quot;&lt;br /&gt;
        &amp;quot;Label1&lt;br /&gt;
        &amp;quot;&lt;br /&gt;
        Me.Label1.Location = New System.Drawing.Point(8, 16)&lt;br /&gt;
        Me.Label1.Name = &amp;quot;Label1&amp;quot;&lt;br /&gt;
        Me.Label1.Size = New System.Drawing.Size(80, 16)&lt;br /&gt;
        Me.Label1.TabIndex = 0&lt;br /&gt;
        Me.Label1.Text = &amp;quot;X coordinate&amp;quot;&lt;br /&gt;
        &amp;quot;&lt;br /&gt;
        &amp;quot;Label3&lt;br /&gt;
        &amp;quot;&lt;br /&gt;
        Me.Label3.Location = New System.Drawing.Point(8, 64)&lt;br /&gt;
        Me.Label3.Name = &amp;quot;Label3&amp;quot;&lt;br /&gt;
        Me.Label3.Size = New System.Drawing.Size(80, 16)&lt;br /&gt;
        Me.Label3.TabIndex = 2&lt;br /&gt;
        Me.Label3.Text = &amp;quot;Y coordinate&amp;quot;&lt;br /&gt;
        &amp;quot;&lt;br /&gt;
        &amp;quot;lblX&lt;br /&gt;
        &amp;quot;&lt;br /&gt;
        Me.lblX.Location = New System.Drawing.Point(184, 16)&lt;br /&gt;
        Me.lblX.Name = &amp;quot;lblX&amp;quot;&lt;br /&gt;
        Me.lblX.Size = New System.Drawing.Size(80, 16)&lt;br /&gt;
        Me.lblX.TabIndex = 1&lt;br /&gt;
        &amp;quot;&lt;br /&gt;
        &amp;quot;lblY&lt;br /&gt;
        &amp;quot;&lt;br /&gt;
        Me.lblY.Location = New System.Drawing.Point(184, 64)&lt;br /&gt;
        Me.lblY.Name = &amp;quot;lblY&amp;quot;&lt;br /&gt;
        Me.lblY.Size = New System.Drawing.Size(80, 16)&lt;br /&gt;
        Me.lblY.TabIndex = 3&lt;br /&gt;
        &amp;quot;&lt;br /&gt;
        &amp;quot;Form1&lt;br /&gt;
        &amp;quot;&lt;br /&gt;
        Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13)&lt;br /&gt;
        Me.ClientSize = New System.Drawing.Size(312, 101)&lt;br /&gt;
        Me.Controls.AddRange(New System.Windows.Forms.Control() {Me.lblY, Me.Label3, Me.lblX, Me.Label1})&lt;br /&gt;
        Me.Name = &amp;quot;Form1&amp;quot;&lt;br /&gt;
        Me.Text = &amp;quot;Form1&amp;quot;&lt;br /&gt;
        Me.ResumeLayout(False)&lt;br /&gt;
    End Sub&lt;br /&gt;
#End Region&lt;br /&gt;
    Private Sub Form1_MouseMove(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles MyBase.MouseMove&lt;br /&gt;
        lblX.Text = e.X&lt;br /&gt;
        lblY.Text = e.Y&lt;br /&gt;
    End Sub&lt;br /&gt;
End Class&amp;lt;/source&amp;gt;&lt;/div&gt;</summary>
		<author><name>Admin</name></author>	</entry>

	</feed>