Results 1 to 8 of 8

Thread: [RESOLVED] mouse over text

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Feb 2008
    Location
    Australia
    Posts
    145

    Resolved [RESOLVED] mouse over text

    is there an easy way (in visual basic language) to display some text when you put your mouse over a button - like the help text that appears in other windows applications. like when you put your mouse over button 1 a little message appears at the mouse saying "Refresh".
    thanks...

  2. #2
    PowerPoster
    Join Date
    Oct 2002
    Location
    British Columbia
    Posts
    9,758

    Re: mouse over text

    Set the ToolTip property/attribute.

    <asp:Button ID="Button1" runat="server" Text="Button" ToolTip="Refresh"/>

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    Feb 2008
    Location
    Australia
    Posts
    145

    Re: mouse over text

    thanks
    do you have the code in vb language?

  4. #4
    PowerPoster
    Join Date
    Oct 2002
    Location
    British Columbia
    Posts
    9,758

    Re: mouse over text

    If the button is declared on the aspx page the code would simply be

    Me.Button1.ToolTip = "Refresh"

  5. #5

    Thread Starter
    Addicted Member
    Join Date
    Feb 2008
    Location
    Australia
    Posts
    145

    Re: mouse over text

    awesome thanks

  6. #6

    Thread Starter
    Addicted Member
    Join Date
    Feb 2008
    Location
    Australia
    Posts
    145

    Re: mouse over text

    but which event do i put that code in?

  7. #7
    KrisSiegel.com Kasracer's Avatar
    Join Date
    Jul 2003
    Location
    USA, Maryland
    Posts
    4,985

    Re: mouse over text

    You should add that text in the ASP.Net page itself rather than a code behind (since it's content oriented). If the link / button is dynamically generated then add them during the Page Load event.

    If your dynamic links are generated in an event then add the ToolTip there instead of Page Load.

    Fyi, text that appears when you hover are title attributes in html. The ToolTrip will automatically be renamed title when the html is generated. The alt attribute will sometimes do this but it wasn't meant to.
    KrisSiegel.com - My Personal Website with my blog and portfolio
    Don't Forget to Rate Posts!

    Free Icons: FamFamFam, VBCorner, VBAccelerator
    Useful Links: System.Security.SecureString Managed DPAPI Overview Part 1 Managed DPAPI Overview Part 2 MSDN, MSDN2, Comparing the Timer Classes

  8. #8

    Thread Starter
    Addicted Member
    Join Date
    Feb 2008
    Location
    Australia
    Posts
    145

    Re: mouse over text

    ok thanks alot

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