Victor Charles
asked on
Help with viewing definition of acronym when placing mouse on a row of a listbox
Hi,
I have a listbox with multiple rows containing acronyms, when I place a my cursor on a row, how do I display the definition of the row my mouse is over using VB.NET?, for example when place mouse on row containing NSC would like to see National Short Code
Thanks,
Victor
I have a listbox with multiple rows containing acronyms, when I place a my cursor on a row, how do I display the definition of the row my mouse is over using VB.NET?, for example when place mouse on row containing NSC would like to see National Short Code
Thanks,
Victor
ASKER
Thank You.
ASKER
Hello,
My apology for the late reply.
How do you create the acronym definition and bound it to the list box row?
Victor
My apology for the late reply.
How do you create the acronym definition and bound it to the list box row?
Victor
With this:
-saige-
Private Sub OnLoad(sender As Object, e As EventArgs) Handles MyBase.Load
ListBox1.DataSource = (From i In Enumerable.Range(0, 20) Select New Acronym() With {.ID = i, .Acronym = String.Format("ACR{0}", i), .Definition = String.Format("Definition for ACR{0}", i)}).ToList()
ListBox1.DisplayMember = "Acronym"
End Sub
Which uses this class definition for Acronym:
Class Acronym
Public Property ID() As Integer
Public Property Acronym() As String
Public Property Definition() As String
End Class
-saige-
ASKER
Hi,
How do I build the part to display the definition?
For example if mouse is over SN row to display "Serial Number"?
Thanks,
Victor
How do I build the part to display the definition?
For example if mouse is over SN row to display "Serial Number"?
Thanks,
Victor
ASKER CERTIFIED SOLUTION
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
Form1.vb -
Open in new window
Form1.Designer.vb -Open in new window
Which produces the following output --saige-