So I have a huge class hierarch I am working with. I would like to store the objects of these classes in a ListBox and have a certain attribute used for the ListBox text. So my plan is to make a User Control and inherit from the ListBox. Is there a function that I can override that will let me print what I want for the ListBox text?
Ps I do not want to override the toString functions in my other classes

Is there a better place to post this question so I can get a reply faster? I really need an answer to this question fast

OK so ic an now draw a diffrent string by using the following code

private sub myList(ByVal sender As Object, ByVal e As System.Windows.Forms.DrawItemEventArgs) Handles MyBase.DrawItem
        If Me.Items.Count > 0 Then
            e.DrawBackground()

            e.Graphics.DrawString("SomeText", e.Font, New SolidBrush(e.ForeColor), e.Bounds.X, e.Bounds.Y)
        End If
    End Sub

However I do not get the horizontal scroll bar anymore!?!?!? How do I get that back?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.