That's perfect. Exactly what I needed. Why is it that I can't find this
"Ken Tucker [MVP]" <vb2ae@bellsouth.net> wrote in message
news:uu2EDSshFHA.3912@tk2msftngp13.phx.gbl...
> Hi,
>
> Maybe this will help.
>
>
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnwinforms/html/custcntrlsamp3.asp
>
> Ken
> --------------------
> "Rlrcstr" <rlrcstr@msn.com> wrote in message
> news:ObIDCOnhFHA.3544@TK2MSFTNGP15.phx.gbl...
> Yes. I know I can do that... I want to create my own control for
> displaying the data. It is a listbox type of control, but it isn't based
on
> a ListBox. There were many issues drawing the inner controls, etc. when I
> tried inheriting from a ListBox. Using a scrollable panel, I was able to
> overcome the display issues, but I need to know how I can add my own data
> bindings. Do you have to just iterate through the full list and assign
> bindings to all the controls, or is there some mechanism that I can
> implement using the binding classes?
>
> I'm not sure if I'm explaining this well enough, so feel free to ask for
> clarification where needed.
>
> Thanks.
>
> Jerry
>
>
>
>
> "Ken Tucker [MVP]" <vb2ae@bellsouth.net> wrote in message
> news:OT%23s4EnhFHA.1252@TK2MSFTNGP09.phx.gbl...
> > Hi,
> >
> > You can already do that.
> >
> > Dim arBook As ArrayList
> >
> >
> >
> > Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As
> > System.EventArgs) Handles MyBase.Load
> >
> > Dim cBook As Book
> >
> > Dim x As Integer
> >
> > arBook = New ArrayList
> >
> > For x = 1 To 10
> >
> > cBook = New Book
> >
> > cBook.Name = "Book " & x.ToString
> >
> > cBook.ID = x
> >
> > arBook.Add(cBook)
> >
> > Next
> >
> > ListBox1.DataSource = arBook
> >
> > ListBox1.DisplayMember = "Name"
> >
> > End Sub
> >
> >
> > The class
> >
> >
> > Public Class Book
> >
> > Private m_name As String
> >
> > Dim m_ID As String
> >
> > Public Property Name() As String
> >
> > Get
> >
> > Return m_name
> >
> > End Get
> >
> > Set(ByVal Value As String)
> >
> > m_name = Value
> >
> > End Set
> >
> > End Property
> >
> > Public Property ID() As String
> >
> > Get
> >
> > Return m_ID
> >
> > End Get
> >
> > Set(ByVal Value As String)
> >
> > m_ID = Value
> >
> > End Set
> >
> > End Property
> >
> > End Class
> >
> >
> > Ken
> > ----------------
> > "Rlrcstr" <rlrcstr@msn.com> wrote in message
> > news:Orf0LYlhFHA.2852@TK2MSFTNGP15.phx.gbl...
> > Can someone point me to an example of creating data bound custom
controls?
> > I want to create my own customized listbox that I can bind to a custom
> > collection of objects. Thanks.
> >
> > Jerry
> >
> >
> >
> >
>
>
>