• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Visual Basic problem.

Status
Not open for further replies.
Level 9
Joined
Apr 28, 2009
Messages
538
Do anybody knows why the actions executed at MouseHover and MouseLeave events take so long to be executed?


For example, let's say i have a button on my form with red background color and i want the color to change to black when the user moves the mose within the button area.

The color changes, but way to slow (almost after 1 second)


Note: I use the [MyButton].BackColor = Color.[MyColor]

Code:
Public Class Form1

    Private Sub Button8_MouseHover(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button8.MouseHover
        Button1.BackColor = Color.Black
    End Sub

    Private Sub Button8_MouseLeave(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button8.MouseLeave
        Button1.BackColor = Color.Red
    End Sub

End Class

How can i make the color to change instantly?

Thanks!
 
Level 11
Joined
Feb 14, 2009
Messages
884
Which version of VB do you use? Looks like .NET to me, although I've used it only once ^^
I don't know if you can use this on .NET, but I strongly recommend it (and colours change really fast here).
 
Level 11
Joined
Feb 14, 2009
Messages
884
Try using "MouseEnter" event instead of "MouseHover".

This is correct. Hover doesn't occur until a specific period of time passes while your mouse pointer is inside the object (in this case, 1 second). If you change it to MouseEnter, it should work.
 
Level 1
Joined
May 27, 2009
Messages
4
I wish i could show you but my visual studio 2005 and 2008 express editions both don't work because i have to register...

You don't need to register if you install the Visual Studio from an image file. You need to register only if you use the web installer (which you probably did).

You can download the image file here:

Code:
http://www.microsoft.com/express/download

Simply scroll all the way down, there's an 'Offline Install' section, choose your language and click download.
The file's size is 750MB.
 
Status
Not open for further replies.
Top