By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
425,743 Members | 1,018 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 425,743 IT Pros & Developers. It's quick & easy.

Add usercontrol to listbox

P: n/a
HDI
Hi,

How can i make a listbox where I can add a usercontrol at run time?

Thx

Nov 26 '06 #1
Share this Question
Share on Google+
3 Replies


P: n/a
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:
Hi,

How can i make a listbox where I can add a usercontrol at run time?

Thx
Nov 27 '06 #2

P: n/a
HDI wrote:
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.
Nov 27 '06 #3

P: n/a
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
"Phill W." <p-.-a-.-w-a-r-d@o-p-e-n-.-a-c-.-u-kwrote in message
news:ek**********@south.jnrs.ja.net...
HDI wrote:
>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.

Nov 27 '06 #4

This discussion thread is closed

Replies have been disabled for this discussion.