Search - Articles
DevASP.NET for ASP.NET, VB.NET, XML and C# (C-Sharp) Developers Tuesday, March 03, 2009
Dev Articles
Search Directory
ASP.NET
VB.Net
C-Sharp
SQL Server
 

Using Mouse Events To Make Glow Controls

Author: DevASP
Download Source Code : 425_MouseEffects.zip

In this article I will discuss the mouse events against any control. Because mouse events can make effect on your control which is impossible with controls property.

For the proper understanding follow the code property .Mouse has many events .i use some famous events which we usually use in our Professional applications.

 

Mouse enter event Activate when Mouse arrow Enter in the controls boundary. So that’s why I use it when I enter the arrow in the boundary of button its backcolor changes. And also make effect on textbox which shows it can effect on each control.

 

Private Sub Button1_MouseEnter1(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.MouseEnter

 

        Button1.BackColor = Color.Aquamarine

        Label1.BackColor = Color.Aquamarine

        Label1.Text = "Mouse Enter Event"

 

End Sub

 

Mouse Leave event Activate when Mouse arrow Leave in the controls boundary. So that’s why I use it when I leave the boundary of button  by arrow of mouse its back color changes. And also make effect on textbox.

 

Private Sub Button1_MouseLeave1(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.MouseLeave

 

        Button1.BackColor = Color.Blue

        Label1.BackColor = Color.Blue

        Label1.Text = "Mouse Leave Event"

 

End Sub

 

Mouse Hover event Activate when Mouse arrow remain enter for some time in the controls boundary.So when I place mouse arrow remain in the boundary of button, buttons back color changes. And also make effect on textbox.

 

Private Sub Button1_MouseHover1(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.MouseHover

 

        Label1.Text = "Mouse Hover"

        Label1.BackColor = Color.Brown

        Button1.BackColor = Color.Brown

 

End Sub

 

Mouse Down event Activate when Mouse right click pressed in the controls boundary. So when I Right clicked by mouse on the boundary of button, buttons back color changes. And also make effect on textbox.

 

Private Sub Button1_MouseDown(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles Button1.MouseDown

 

        Button1.BackColor = Color.Bisque

        Label1.BackColor = Color.Bisque

        Label1.Text = "Click Event"

 

End Sub

 

In this article I explain the way in which we can use the mouse events against our vb controls.source code is given with that article.

 
Article Comments
mouse events in button to change the colors when mouse over the button

Posted on 4/29/2007 2:09:15 AM by nagabhushanam99

hello sir,
this is ok but in asp.net if we want mouse events then what we have to do .
regards,
sudhanesh.

Posted on 10/31/2008 3:41:05 AM by sudhanesh

   
Add Article Comment:
Name :
Email Address :
   
Comments :
 
   
<< Changing the Desktop Wallpaper Programmatically

Disclaimer - Privacy
© 2002-2017 DevASP.net