Results 1 to 5 of 5

Thread: Mouse Movement & Regions

  1. #1

    Thread Starter
    New Member
    Join Date
    Feb 2003
    Location
    UK, Wales
    Posts
    9

    Unhappy Mouse Movement & Regions

    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

  2. #2
    Junior Member Guile.NET's Avatar
    Join Date
    Mar 2003
    Location
    www.voodoochat.com
    Posts
    31
    Try this:

    VB Code:
    1. Private Sub PictureBox1_MouseLeave(ByVal sender As Object, ByVal e As System.EventArgs) Handles PictureBox1.MouseLeave
    2.         Me.BackColor = System.Drawing.Color.Red
    3.     End Sub
    4.  
    5.     Private Sub PictureBox1_MouseMove(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles PictureBox1.MouseMove
    6.         Me.BackColor = System.Drawing.Color.Blue
    7.     End Sub
    The arrow shot by the archer may, or may not, kill a single person. However, stratagems devised by a wise man, can kill even babes in the womb.

  3. #3

    Thread Starter
    New Member
    Join Date
    Feb 2003
    Location
    UK, Wales
    Posts
    9
    i'm not using a picturebox, i'm using a Graphic (Vector graphics)

  4. #4
    l33t! MrPolite's Avatar
    Join Date
    Sep 2001
    Posts
    4,428
    Umm I think I know what you mean


    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!

    HTH, I dont have access to vb right now, other wise I would write the code for you
    rate my posts if they help ya!
    Extract thumbnail without reading the whole image file: (C# - VB)
    Apply texture to bitmaps: (C# - VB)
    Extended console library: (VB)
    Save JPEG with a certain quality (image compression): (C# - VB )
    VB.NET to C# conversion tips!!

  5. #5
    l33t! MrPolite's Avatar
    Join Date
    Sep 2001
    Posts
    4,428
    need any help? did it work or what?
    rate my posts if they help ya!
    Extract thumbnail without reading the whole image file: (C# - VB)
    Apply texture to bitmaps: (C# - VB)
    Extended console library: (VB)
    Save JPEG with a certain quality (image compression): (C# - VB )
    VB.NET to C# conversion tips!!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width