Add usercontrol to listbox

  • Thread starter Thread starter HDI
  • Start date Start date
The standard listbox control doesn't support this. You might want to
look into some 3rd party controls or make your own control where you
"paint" your usercontrol in the listbox. I recommend looking into 3rd
party controls as painting it yourself will take some time to build.

HDI schreef:
 
HDI said:
How can i make a listbox where I can add a usercontrol at run time?

Don't think you can.
Try the ListView control instead.

This expects you to add ListViewItem's into it or, better still, classes
of your own that are /derived from/ ListViewItem.

HTH,
Phill W.
 
Sure you can.

Dim ctl As New UserControl
ctl.Parent = ListBox1
ctl.Size = New Size(50, 50)
ctl.Location = New Point(10, 10)
ctl.BackColor = Color.Aqua
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top