Click to See Complete Forum and Search --> : Mouse Movement & Regions
ICE32
Mar 7th, 2003, 05:55 AM
Hi all,
My problem is i have a form which when i enter a region with the mouse on the form ie. an circle i want the background colour of the form the change and when i exit the region, (cirlce) the form will change back to it's origional colour.
I hope i have explained this well enough, if not reply and ask me. Hope you can help.
Thanks In Advance
Lee
Guile.NET
Mar 7th, 2003, 06:07 AM
Try this:
Private Sub PictureBox1_MouseLeave(ByVal sender As Object, ByVal e As System.EventArgs) Handles PictureBox1.MouseLeave
Me.BackColor = System.Drawing.Color.Red
End Sub
Private Sub PictureBox1_MouseMove(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles PictureBox1.MouseMove
Me.BackColor = System.Drawing.Color.Blue
End Sub
ICE32
Mar 7th, 2003, 08:58 AM
i'm not using a picturebox, i'm using a Graphic (Vector graphics)
MrPolite
Mar 7th, 2003, 12:35 PM
Umm I think I know what you mean :D
The region has a property called IsVisible(). So lets say you have the region painted in a picturebox, then you have to look at the MouseMove event of that picturebox. In PictureBox_MouseMove you have to check for e.x and e.y ( region.isVisible (e.x,e.y) ) to figure out if the mouse if on the region or not. If true, then change the background color! :D
HTH, I dont have access to vb right now, other wise I would write the code for you
MrPolite
Mar 8th, 2003, 07:38 PM
need any help? did it work or what?:rolleyes:
vbforums.com
Copyright Internet.com Inc., All Rights Reserved.