Results 1 to 5 of 5

Thread: List Control: ToolTip per row

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Jan 2007
    Location
    England
    Posts
    64

    List Control: ToolTip per row

    In vb.net:
    List Control: ToolTip per row. Is this possible?
    I know you can do it per column but can this be done for each row to display a value from the row?

  2. #2
    Learning .Net danasegarane's Avatar
    Join Date
    Aug 2004
    Location
    VBForums
    Posts
    5,853

    Re: List Control: ToolTip per row

    How to you decide the Toolstrip Contents ?
    Please mark you thread resolved using the Thread Tools as shown

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Jan 2007
    Location
    England
    Posts
    64

    Re: List Control: ToolTip per row

    tooltip content will be different for each row.
    On load need to set this when loading rows in!
    and then display when u hover over!

  4. #4
    Learning .Net danasegarane's Avatar
    Join Date
    Aug 2004
    Location
    VBForums
    Posts
    5,853

    Re: List Control: ToolTip per row

    vb Code:
    1. 'Add a Toolstrip in the form
    2. 'Add one Listbox
    3. Class MyItem
    4.         Inherits ListBox
    5.         Public MyShowText As String
    6.         Public MyIntg As Integer
    7.         Public MyStrng As String
    8.         Sub New(ByVal ShowText As String, ByVal Intg As Integer, ByVal Strng As String)
    9.             MyBase.New()
    10.             'transfer all incoming parameters to your local storage
    11.             MyShowText = ShowText
    12.             MyIntg = Intg
    13.             MyStrng = Strng
    14.             'and finally, pass back the Text property
    15.             Me.Text = MyShowText
    16.         End Sub
    17.     End Class
    18. Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
    19.         ListBox1.DisplayMember = "Text"
    20.         ListBox1.Items.Add(New MyItem("ONE", 1, "o_n_e"))
    21.         ListBox1.Items.Add(New MyItem("Two", 2, "Two"))
    22.         ListBox1.Items.Add(New MyItem("Three", 3, "Three"))
    23.     End Sub
    24.  
    25. Private Sub ListBox1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ListBox1.SelectedIndexChanged
    26.         Dim myitem1 As MyItem
    27.         myitem1 = CType(ListBox1.SelectedItem, MyItem)
    28.         ToolTip1.SetToolTip(ListBox1, myitem1.MyStrng)
    29.     End Sub
    Please mark you thread resolved using the Thread Tools as shown

  5. #5

    Thread Starter
    Lively Member
    Join Date
    Jan 2007
    Location
    England
    Posts
    64

    Re: List Control: ToolTip per row

    Thanks man going to check it out
    Brill man thx

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