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 3593926
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T19:38:32+00:00 2026-05-18T19:38:32+00:00

I have a panel with AutoScroll set to true . In it, I am

  • 0

I have a panel with AutoScroll set to true. In it, I am programmatically adding ComboBox controls. If I add enough controls to exceed the viewable size of the panel a scroll bar appears (so far so good). However, if I open one of the combo boxes near the bottom of the viewable area the combo list isn’t properly displayed and the scrollable area seems to be expanded. This results in all of the controls being “pulled” to the new bottom of the panel with some new blank space at the top. If I continue to tap on the drop down at the bottom of the panel the scrollable area will continue to expand indefinitely. I’m anchoring the controls to the left, right and top so I don’t think anchoring is involved. Is there something obvious that could be causing this?

Update: It looks like the problem lies with anchoring the controls to the right. If I don’t anchor to the right then I don’t get the strange behavior. However, without right anchoring the control gets cut off by the scroll bar.

Here’s a simplified test case I built that shows the issue:

    public Form1()
    {
        InitializeComponent();

        Panel panel = new Panel();
        panel.Size = new Size(80, 200);
        panel.AutoScroll = true;

        for (int i = 0; i < 10; ++i)
        {
            ComboBox cb = new ComboBox();
            cb.Anchor = AnchorStyles.Left | AnchorStyles.Right | AnchorStyles.Top;
            cb.Items.Add("Option 1");
            cb.Items.Add("Option 2");
            cb.Items.Add("Option 3");
            cb.Items.Add("Option 4");
            cb.Location = new Point(0, i * 24);
            panel.Controls.Add(cb);
        }

        Controls.Add(panel);
    }

If you scroll the bottom of the panel and tap on the combo boxes near the bottom you’ll notice the strange behavior.

  • 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-18T19:38:33+00:00Added an answer on May 18, 2026 at 7:38 pm

    This seems to be a problem specific to the devices you are using. I can’t reproduce this behavior at all. Have you tried setting the Dock property of the Panel? How about the other properties that affect scrolling behavior (AutoScrollMargin, AutoScrollMinSize, AutoScrollPosition)? I’d also play with the size of the panel, and maybe use the System.Windows.Forms.Screen class to determine it automatically based on the device.

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

Sidebar

Related Questions

I have lots of radiobutton in a panel with auto scroll set to true
I have a panel on my form with AutoScroll set to true so a
I have a created a panel. This has autoscroll = true At the start
I have stack panel with custom controls in it. User can add or remove
I have a Panel and I am adding controls inside this panel. But there
I have panel with the controls and scrolling .By default i set the focus
I have a panel control to which i add image controls from code behind.
I have Panel with a BottomToolbar . I want to add and remove dynamically
I have stack panel with custom controls in it. I attach standard MouseDragElementBehavior to
I have a Panel that I'm setting visible=true explicitly. The debugger passes over that

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.