Image.ToolTip not working

Discussion in 'ASP .Net' started by SteFetS, Jan 19, 2005.

  1. SteFetS

    SteFetS Guest

    Hi,

    I have a webapplication (asp.net)

    Snippet:
    Dim Img As New System.Web.UI.WebControls.Image
    Img.ID = "Image1"
    Img.ToolTip = "Trou"
    Img.ImageUrl = "http://localhost/images/0.bmp"
    Img.Style.Add("left", "50%")
    Img.Style.Add("top", "50%")
    Img.Style.Add("position", "absolute")
    Page.Controls.Add(Img)

    I see the image on my form

    When I place the cursor over the image the Tooltip is not displayed !
    Also, I cannot save the Image with Right Click !

    How can I display the ToolTip ?

    Thanks
    Stephane Gagnon
     
    SteFetS, Jan 19, 2005
    #1
    1. Advertising

  2. I tested ur code and i can see the tooltip !!

    "SteFetS" wrote:

    > Hi,
    >
    > I have a webapplication (asp.net)
    >
    > Snippet:
    > Dim Img As New System.Web.UI.WebControls.Image
    > Img.ID = "Image1"
    > Img.ToolTip = "Trou"
    > Img.ImageUrl = "http://localhost/images/0.bmp"
    > Img.Style.Add("left", "50%")
    > Img.Style.Add("top", "50%")
    > Img.Style.Add("position", "absolute")
    > Page.Controls.Add(Img)
    >
    > I see the image on my form
    >
    > When I place the cursor over the image the Tooltip is not displayed !
    > Also, I cannot save the Image with Right Click !
    >
    > How can I display the ToolTip ?
    >
    > Thanks
    > Stephane Gagnon
    >
     
    =?Utf-8?B?dmluYXk=?=, Jan 19, 2005
    #2
    1. Advertising

  3. SteFetS

    SteFetS Guest

    "=?Utf-8?B?dmluYXk=?=" <> wrote in
    news::

    > I tested ur code and i can see the tooltip !!
    >


    Doo! I don't understand.... Have u put the snippet in the Page_Load sub ?
     
    SteFetS, Jan 19, 2005
    #3
  4. SteFetS

    SteFetS Guest

    "=?Utf-8?B?dmluYXk=?=" <> wrote in
    news::

    > I tested ur code and i can see the tooltip !!


    Ok ... try this and the tooltip will not work

    I think it is because the image is ''UNDER'' the Table

    ____

    Dim Img As New System.Web.UI.WebControls.Image
    Img.ID = "Image1"
    Img.ToolTip = "Trou"
    Img.ImageUrl = "http://localhost/images/0.bmp"
    Img.Style.Add("left", "50%")
    Img.Style.Add("top", "50%")
    Img.Style.Add("position", "absolute")
    Page.Controls.Add(Img)

    Dim TotalJeux As Integer = 5
    Dim RollPerJeu As Integer = 5

    Dim j As Integer

    For j = 0 To TotalJeux - 1

    Dim Jeu As New TableRow
    Jeu.Width = Unit.Percentage(100)
    Trim.Rows.Add(Jeu)

    Dim i As Integer
    For i = 0 To RollPerJeu - 1
    Dim Rouleau As New TableCell
    Rouleau.Text = "Rouleau" & i.ToString
    Rouleau.BorderColor = Color.Black
    Rouleau.BorderStyle = BorderStyle.Solid
    Rouleau.BorderWidth = Unit.Pixel(1)
    Select Case i
    Case 0
    Rouleau.Width = Unit.Percentage(20)
    Case 1
    Rouleau.Width = Unit.Percentage(30)
    Case 2
    Rouleau.Width = Unit.Percentage(20)
    Case 3
    Rouleau.Width = Unit.Percentage(10)
    Case 4
    Rouleau.Width = Unit.Percentage(20)
    End Select

    Jeu.Cells.Add(Rouleau)

    Next i

    Next j


    End Sub
     
    SteFetS, Jan 19, 2005
    #4
  5. Maybe you have Web Browser compatibility issue.

    From MSDN about ToolTip:
    "This property is rendered for all browsers. However, only Microsoft
    Internet Explorer will display this property as a ToolTip. All other
    browsers will ignore this property".

    Leszek Taratuta

    "SteFetS" <> wrote in message
    news:Xns95E37976E9F13NOSPAMgagnonshotmail@207.35.177.135...
    > Hi,
    >
    > I have a webapplication (asp.net)
    >
    > Snippet:
    > Dim Img As New System.Web.UI.WebControls.Image
    > Img.ID = "Image1"
    > Img.ToolTip = "Trou"
    > Img.ImageUrl = "http://localhost/images/0.bmp"
    > Img.Style.Add("left", "50%")
    > Img.Style.Add("top", "50%")
    > Img.Style.Add("position", "absolute")
    > Page.Controls.Add(Img)
    >
    > I see the image on my form
    >
    > When I place the cursor over the image the Tooltip is not displayed !
    > Also, I cannot save the Image with Right Click !
    >
    > How can I display the ToolTip ?
    >
    > Thanks
    > Stephane Gagnon
     
    Leszek Taratuta, Jan 19, 2005
    #5
  6. SteFetS

    SteFetS Guest

    "Leszek Taratuta" <> wrote in news:ek$U6Wl$EHA.1524
    @TK2MSFTNGP09.phx.gbl:

    > Maybe you have Web Browser compatibility issue.


    Look at my last post in this topic.

    I create a table with rows and cells

    After I create an Image and the tooltip is not working.

    If I don't create the table the tooltip work fine.
     
    SteFetS, Jan 19, 2005
    #6
  7. This is what i got in viewsource..
    Please check the page viewsource if it has created "title='Trou'"

    <img id="Image1" title="Trou"
    src="http://localhost/WebApplication1/CGAM.bmp" border="0"
    style="left:50%;top:50%;position:absolute;" />


    "SteFetS" wrote:

    > "Leszek Taratuta" <> wrote in news:ek$U6Wl$EHA.1524
    > @TK2MSFTNGP09.phx.gbl:
    >
    > > Maybe you have Web Browser compatibility issue.

    >
    > Look at my last post in this topic.
    >
    > I create a table with rows and cells
    >
    > After I create an Image and the tooltip is not working.
    >
    > If I don't create the table the tooltip work fine.
    >
    >
     
    =?Utf-8?B?dmluYXk=?=, Jan 19, 2005
    #7
  8. SteFetS

    SteFetS Guest

    "=?Utf-8?B?dmluYXk=?=" <> wrote in
    news:D:

    > This is what i got in viewsource..
    > Please check the page viewsource if it has created "title='Trou'"
    >


    Yes I have it but try the following code and it will not work no more :eek:(


    Sub Page_Load

    Dim Img As New System.Web.UI.WebControls.Image
    Img.ID = "Image1"
    Img.ToolTip = "Trou"
    Img.ImageUrl = "http://localhost/images/0.bmp"
    Img.Style.Add("left", "50%")
    Img.Style.Add("top", "50%")
    Img.Style.Add("position", "absolute")
    Page.Controls.Add(Img)

    Dim TotalJeux As Integer = 5
    Dim RollPerJeu As Integer = 5

    Dim j As Integer

    For j = 0 To TotalJeux - 1

    Dim Jeu As New TableRow
    Jeu.Width = Unit.Percentage(100)
    Trim.Rows.Add(Jeu)

    Dim i As Integer
    For i = 0 To RollPerJeu - 1
    Dim Rouleau As New TableCell
    Rouleau.Text = "Rouleau" & i.ToString
    Rouleau.BorderColor = Color.Black
    Rouleau.BorderStyle = BorderStyle.Solid
    Rouleau.BorderWidth = Unit.Pixel(1)
    Select Case i
    Case 0
    Rouleau.Width = Unit.Percentage(20)
    Case 1
    Rouleau.Width = Unit.Percentage(30)
    Case 2
    Rouleau.Width = Unit.Percentage(20)
    Case 3
    Rouleau.Width = Unit.Percentage(10)
    Case 4
    Rouleau.Width = Unit.Percentage(20)
    End Select

    Jeu.Cells.Add(Rouleau)

    Next i

    Next j
    End Sub
     
    SteFetS, Jan 19, 2005
    #8
  9. it works, try this ..

    Dim TotalJeux As Integer = 5
    Dim RollPerJeu As Integer = 5

    Dim j As Integer

    For j = 0 To TotalJeux - 1

    Dim Jeu As New TableRow
    Jeu.Width = Unit.Percentage(100)
    Trim.Rows.Add(Jeu)

    Dim i As Integer
    For i = 0 To RollPerJeu - 1

    Dim Img As New System.Web.UI.WebControls.Image
    Img.ID = "Image" & i
    Img.ToolTip = "Trou" & i
    Img.ImageUrl = "http://localhost/WebApplication1/GE Logo1.jpg"

    Dim Rouleau As New TableCell
    Rouleau.Text = "Rouleau" & i.ToString
    Rouleau.BorderColor = Color.Black
    Rouleau.BorderStyle = BorderStyle.Solid
    Rouleau.BorderWidth = Unit.Pixel(1)
    Select Case i
    Case 0
    Rouleau.Width = Unit.Percentage(20)
    Rouleau.Controls.Add(Img)
    Case 1
    Rouleau.Width = Unit.Percentage(30)
    Rouleau.Controls.Add(Img)
    Case 2
    Rouleau.Width = Unit.Percentage(20)
    Rouleau.Controls.Add(Img)
    Case 3
    Rouleau.Width = Unit.Percentage(10)
    Rouleau.Controls.Add(Img)
    Case 4
    Rouleau.Width = Unit.Percentage(20)
    Rouleau.Controls.Add(Img)
    End Select

    Jeu.Cells.Add(Rouleau)

    Next i

    Next j




    "SteFetS" wrote:

    > "=?Utf-8?B?dmluYXk=?=" <> wrote in
    > news:D:
    >
    > > This is what i got in viewsource..
    > > Please check the page viewsource if it has created "title='Trou'"
    > >

    >
    > Yes I have it but try the following code and it will not work no more :eek:(
    >
    >
    > Sub Page_Load
    >
    > Dim Img As New System.Web.UI.WebControls.Image
    > Img.ID = "Image1"
    > Img.ToolTip = "Trou"
    > Img.ImageUrl = "http://localhost/images/0.bmp"
    > Img.Style.Add("left", "50%")
    > Img.Style.Add("top", "50%")
    > Img.Style.Add("position", "absolute")
    > Page.Controls.Add(Img)
    >
    > Dim TotalJeux As Integer = 5
    > Dim RollPerJeu As Integer = 5
    >
    > Dim j As Integer
    >
    > For j = 0 To TotalJeux - 1
    >
    > Dim Jeu As New TableRow
    > Jeu.Width = Unit.Percentage(100)
    > Trim.Rows.Add(Jeu)
    >
    > Dim i As Integer
    > For i = 0 To RollPerJeu - 1
    > Dim Rouleau As New TableCell
    > Rouleau.Text = "Rouleau" & i.ToString
    > Rouleau.BorderColor = Color.Black
    > Rouleau.BorderStyle = BorderStyle.Solid
    > Rouleau.BorderWidth = Unit.Pixel(1)
    > Select Case i
    > Case 0
    > Rouleau.Width = Unit.Percentage(20)
    > Case 1
    > Rouleau.Width = Unit.Percentage(30)
    > Case 2
    > Rouleau.Width = Unit.Percentage(20)
    > Case 3
    > Rouleau.Width = Unit.Percentage(10)
    > Case 4
    > Rouleau.Width = Unit.Percentage(20)
    > End Select
    >
    > Jeu.Cells.Add(Rouleau)
    >
    > Next i
    >
    > Next j
    > End Sub
    >
     
    =?Utf-8?B?dmluYXk=?=, Jan 19, 2005
    #9
  10. SteFetS

    SteFetS Guest

    "=?Utf-8?B?dmluYXk=?=" <> wrote in
    news::

    > it works, try this ..


    Yes It works :)

    But... if I add text property for the TableCell, it is not displayed !

    Rouleau.Width = Unit.Percentage(20)
    Rouleau.Text = "B0A55A2001100"
    Rouleau.Controls.Add(Img)

    Text and Image cannot cohabit within a TableCell ?

    PS: I don't see the Text when I View Source :(
     
    SteFetS, Jan 20, 2005
    #10
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Bart Schelkens

    Tooltip on a part of an image

    Bart Schelkens, Dec 1, 2004, in forum: ASP .Net
    Replies:
    2
    Views:
    357
    Franck Quintana
    Dec 1, 2004
  2. Erik23a86

    wxPython: Image in a tooltip

    Erik23a86, Nov 14, 2006, in forum: Python
    Replies:
    0
    Views:
    531
    Erik23a86
    Nov 14, 2006
  3. Radu
    Replies:
    1
    Views:
    566
    Bruce Barker
    Jan 8, 2007
  4. IMAGE IN THE TOOLTIP

    , Oct 5, 2005, in forum: Javascript
    Replies:
    1
    Views:
    102
    Xandax
    Oct 5, 2005
  5. Replies:
    2
    Views:
    116
Loading...

Share This Page