Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

I am reading this book VB.Net Step by Step and getting a head jump on vb before I take it in college. At any rate .. the author wrote something in here and I checked his errors page online and this is not listed, so I was wondering if it was me or if it is an error

 

I used this code for the hover (after selecting the listbox in Classname and MouseHover in Method Name)

 

If listbox.selectedindex < 0 Or listbox.selectedindex > 4 Then

label.Text = "blah blah blah"

End If

 

Now he said that you should have to hold the mouse on top of a listbox selection for a few moments and then the hover message would pop up. But the moment I hover over a selection that message pops up. I have tried playing around with this code a while and cant find a combination of <'s or >'s, and, or, AndAlso, OrElse and a ton others that will make this delay work. Can someone explain what I have to do to correct this problem.

 

Also, I was wondering another thing. When I do hover and get the message, that message stays, until I select the selectedindex and then the message goes away. What would I have to add to the code to make it so that when I hover over it (with the correct specified hover time) it would show the message, but when I moved my mouse to another section of the form, the message would go away, and of course then come back again when I hover over a selection again.

  • *Gurus*
Posted

There is a mouseleave event where you could clear the box if you wished.

 

If he said that that code would make the text appear when you move the mouse over the listbox, he is correct. It won't do anything apart from that though.

MVP, Visual Developer - .NET

 

Now you see why evil will always triumph - because good is dumb.

 

My free .NET Windows Forms Controls and Articles

Guest sticksbs
Posted

Any chance that you meant to be using a text tool tip, rather than assigning text to a label?

 

Because if you use a tool tip then when you hover over it, there is a delay before the text appears, and it goes away after you exit the list area.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...