Home All Groups Group Topic Archive Search About

Add usercontrol to listbox

Author
26 Nov 2006 8:03 PM
HDI
Hi,

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

Thx

Author
27 Nov 2006 8:56 AM
Michel van den Berg
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:

Show quoteHide quote
> Hi,
>
> How can i make a listbox where I can add a usercontrol at run time?
>
> Thx
Author
27 Nov 2006 1:58 PM
Phill W.
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.
Author
27 Nov 2006 4:17 PM
Mudhead
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


Show quoteHide quote
"Phill W." <p-.-a-.-w-a-r-d@o-p-e-n-.-a-c-.-u-k> wrote in message
news:ekeqv0$s77$3@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.