473,386 Members | 1,705 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Add usercontrol to listbox

HDI
Hi,

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

Thx

Nov 26 '06 #1
3 2746
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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Peter Osawa | last post by:
Hi, how can I insert an UserControl as an item in a listbox... I need this because the amount of UCs displayed isn't alwyas the same, and I think that displaying UCs in a listbox is the cleanest...
0
by: N. Demos | last post by:
Hello, I have a custom usercontrol, of which I have two instances of in my aspx page. Both the usercontrol and page have codebehind. In the page codebehind, I want a member variable for each...
2
by: Able | last post by:
Dear friends I have placed a Listbox on a Usercontrol. How do I move the Listbox to upper left corner and make the listbox same size as usercontrol when resizing usercontrol in designtime? ...
3
by: Kim | last post by:
I have a user control with 3 dropdownlist when a user selects the first listbox based on his/her selection the 2 listbox will load based off the users selection from the 2nd listbox the 3rd listbox...
10
by: Benton | last post by:
Hi there, I have a UserControl with a couple of textboxes and a couple of buttons ("Save" and "Cancel"). The Click event for this buttons is in the UserControl's codebehind of course, so here's...
4
by: igotyourdotnet | last post by:
I have a dropdown on my page and I want to define what should be selected in the drop down when the page loads. I have a session variable I'm setting to do this. I can get the selected value and...
1
by: stimul8d | last post by:
okay; ASP. I have i listbox inside a user control which is dynamically created on page_init. I check for postback and only populate the datasource if it's false. regardless, i do this ...
6
by: sundarvenkata | last post by:
Hi All, I have a custom UserControl that is used as the list item in a listbox in my main WPF window. Is it possible to have key bindings that apply to every instance of the user control? For...
6
by: kucheravy | last post by:
Hi, everybody. I have this problem. When I put a <asp:ListBox on a web page and populate the data in the page Page_Load event the ViewState for the control is saved and loaded (after postback)...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.