Results 1 to 5 of 5

Thread: [2005] Changing status text, using mousehover

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Dec 2006
    Location
    London, England
    Posts
    142

    Post [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:
    1. Private Sub mnuFav_MouseHover(ByVal sender As Object, ByVal e As System.EventArgs) Handles mnuFav.MouseHover
    2.  
    3.         tsslStatus.Text = (CStr(DirectCast(sender, ToolStripMenuItem).Text))
    4.     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

  2. #2
    Fanatic Member
    Join Date
    Aug 2006
    Posts
    734

    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

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    Dec 2006
    Location
    London, England
    Posts
    142

    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:
    1. 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

  4. #4
    Fanatic Member
    Join Date
    Aug 2006
    Posts
    734

    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:
    1. Dim ms As New MenuStrip()
    2.       Dim windowMenu As New ToolStripMenuItem("Window")
    3.       Dim windowNewMenu As New ToolStripMenuItem("New", Nothing, New EventHandler(AddressOf windowNewMenu_Click))
    4.       windowMenu.DropDownItems.Add(windowNewMenu)
    5.       CType(windowMenu.DropDown, ToolStripDropDownMenu).ShowImageMargin = False
    6.       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

  5. #5

    Thread Starter
    Addicted Member
    Join Date
    Dec 2006
    Location
    London, England
    Posts
    142

    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:
    1. subFolders.DropDownItems.Add(strFavPath, Nothing, New eventhandler(AddressOf mnuFav_Click)).Tag = fUrl
    2.                     AddHandler subFolders.MouseHover, AddressOf mnuFav_MouseHover
    3.                     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:
    1. mnuFav.DropDownItems.Add(strFavPath, Nothing, AddressOf mnuFav_Click).Tag = fUrl
    2.                     AddHandler mnuFav.MouseHover, AddressOf mnuFav_MouseHover
    3.                     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
  •  



Click Here to Expand Forum to Full Width