|
-
Dec 19th, 2006, 07:08 AM
#1
Thread Starter
Addicted Member
[2005] Changing status text, using mousehover
I've been building a IE clone, and i'm putting the finishing touches on it, Does anyone know how to change the statusbar text to whatever favorite name i have the mouse over, so far i have this code.
VB Code:
Private Sub mnuFav_MouseHover(ByVal sender As Object, ByVal e As System.EventArgs) Handles mnuFav.MouseHover
tsslStatus.Text = (CStr(DirectCast(sender, ToolStripMenuItem).Text))
End Sub
I thought using sender would work, and it does, it activates when the mouse is over F&avorite, but when i try to run the mouse over any of the other url's in the menu, nothing, the event doesn't fire at all. Would this have anything to do with the fact that i'm populating the menu at runtime?? Is there anyway around this?
Redmo
The universal aptitude for ineptitude makes any human accomplishment an incredible miracle -Col. John P. Stapp
Please rate the posts that have helped. Makes us feel all warm and fuzzy
-
Dec 19th, 2006, 07:10 AM
#2
Fanatic Member
Re: [2005] Changing status text, using mousehover
Have you tried adding handlers to the menu items when creating them at run time? (I dont know whether they are automatically created when creating menu items)
Hope this helps
If your problem has been solved then please mark the thread [RESOLVED].
If i have helped then please Rate my post 
-
Dec 19th, 2006, 07:14 AM
#3
Thread Starter
Addicted Member
Re: [2005] Changing status text, using mousehover
Hey Kimmy, no, handlers aren't created automatically, but i have added them to handle the url's(a trick that took me ages to get right )
here's a the code used for adding to the menu at runtime
VB Code:
mnuFav.DropDownItems.Add(strFavPath, Nothing, AddressOf mnuFav_Click).Tag = fUrl
Where furl strips and adds the url as it loops through the favfolder/subfolders
I was thinking, since the text property is set aswell, sender should pick it up when i put the mouseover...
Redmo
The universal aptitude for ineptitude makes any human accomplishment an incredible miracle -Col. John P. Stapp
Please rate the posts that have helped. Makes us feel all warm and fuzzy
-
Dec 19th, 2006, 07:31 AM
#4
Fanatic Member
Re: [2005] Changing status text, using mousehover
Have you tried saying New EventHandler(addressof) coz i jus found this.... (i have to admit i have never used a menustrip before so cant tell you exactly where things are wrong! sorry)
VB Code:
Dim ms As New MenuStrip()
Dim windowMenu As New ToolStripMenuItem("Window")
Dim windowNewMenu As New ToolStripMenuItem("New", Nothing, New EventHandler(AddressOf windowNewMenu_Click))
windowMenu.DropDownItems.Add(windowNewMenu)
CType(windowMenu.DropDown, ToolStripDropDownMenu).ShowImageMargin = False
CType(windowMenu.DropDown, ToolStripDropDownMenu).ShowCheckMargin = True
Hope this helps
If your problem has been solved then please mark the thread [RESOLVED].
If i have helped then please Rate my post 
-
Dec 19th, 2006, 07:58 AM
#5
Thread Starter
Addicted Member
Re: [2005] Changing status text, using mousehover
I've added the following code under where i'm populating the toolstripmenuitem, with some interesting results
VB Code:
subFolders.DropDownItems.Add(strFavPath, Nothing, New eventhandler(AddressOf mnuFav_Click)).Tag = fUrl
AddHandler subFolders.MouseHover, AddressOf mnuFav_MouseHover
AddHandler subFolders.MouseMove, AddressOf mnuFav_MouseMove
when i put the mouse over the subfolder names, they appear on the status bar, but the contents of the subfolder still have nothing.
This is what i've added for the rest of the favorites
VB Code:
mnuFav.DropDownItems.Add(strFavPath, Nothing, AddressOf mnuFav_Click).Tag = fUrl
AddHandler mnuFav.MouseHover, AddressOf mnuFav_MouseHover
AddHandler mnuFav.MouseMove, AddressOf mnuFav_MouseMove
But this still does noting.. 
Redmo
The universal aptitude for ineptitude makes any human accomplishment an incredible miracle -Col. John P. Stapp
Please rate the posts that have helped. Makes us feel all warm and fuzzy
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|