Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3871832
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T21:51:42+00:00 2026-05-19T21:51:42+00:00

I am adding user control to listbox. Everything works fine but i have a

  • 0

I am adding user control to listbox. Everything works fine but i have a problem that when i add 10 user controls then i am expecting that listbox should show scroll so that i can select items at the end of listbox but this never happens even after setting show scroll property to true.

here is my code

UserControl1 button = new UserControl1();

button.Location = new Point(10, 100 * i + 10);
button.Size = new System.Drawing.Size(560, 59);
button.MessageUsername = "Wao this is great";
listBox1.Controls.Add(button);

I am open to ideas

here is the picture you can see that there is no scroll enter image description here

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-19T21:51:43+00:00Added an answer on May 19, 2026 at 9:51 pm

    Where do people get the idea that a ListBox is a container control? That’s not what a ListBox is for, it’s not designed to hold child controls added with the Controls.Add method. You’re supposed to add (and otherwise manage) the items it displays using its aptly-named Items property.

    There’s no scroll bars visible because you’ve just overlaid each of the child controls on top of one another. The ListBox itself doesn’t know about them, so it doesn’t know that it needs to scroll them.

    You should be using some type of panel control, either the Panel control itself, or better yet one that will manage layout for you automatically. Investigate the FlowLayoutPanel or TableLayoutPanel. All of those controls have an AutoScroll property you can set to “True” that will automatically show the scrollbars whenever their contents exceed the visible client area.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have created a user control to handle adding comments to certain business entities,
I am adding some user controls dynamically to a PlaceHolder server control. My user
i have a dropdownlist (asp.net control) and a listbox control and a Add button
I have a recursively defined user control that needs the following properties: there are
I have adding the wpf user control and build the project. However elementhost still
I have some class (a user control) MyUserControl that rises events. I use it
I have a user control that's got an image ..when I added it to
I have a user control that contains a combobox. I want to be able
I'm dynamically adding a custom user control to the page as per this post
I am creating a user control in C# and I am adding my own

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.