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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T20:17:30+00:00 2026-06-01T20:17:30+00:00

I have a custom UserControl with a function that updates the AutoScrollMinSize each time

  • 0

I have a custom UserControl with a function that updates the AutoScrollMinSize each time the control is resized. This control is set to DockStyle.Fill inside a parent form with some other controls.

My problem is that when I minimize or maximize the container form, it sends two consecutive resize events and for some reason my scroll bars disappear.

When I resize the form by resizing the form border, the scroll bars update perfectly every time. It’s only when I minimize or maximize that the scroll bars disappear.

I’ve tried subscribing to both OnResize and OnSizeChanged separately or together and have the same problem. I’ve tried only setting AutoScrollMinSize if the new value is not equal to the current value (in case there was some glitch in setting it twice to the same value) but I still have this problem.

My control styles are as follows:

this.SetStyle(ControlStyles.DoubleBuffer |
              ControlStyles.AllPaintingInWmPaint |
              ControlStyles.UserPaint |
              ControlStyles.ResizeRedraw, true);

this.DoubleBuffered = true;
this.AutoScroll = true;
  • 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-06-01T20:17:31+00:00Added an answer on June 1, 2026 at 8:17 pm

    Not a perfect solution, but I found that calling PerformLayout() after I set AutoScrollMinSize forces the scroll bars to show.

    AutoScrollMinSize = newSize;
    PerformLayout();
    Invalidate();
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a custom UserControl that have a StatusStrip. So, I resize this control
I have a custom control that inherits from UserControl , and I can't get
I have a Custom usercontrol that I want to enlarge. I tested this whit
I have an custom UserControl that displays an image, i'm trying to use this
I have a custom UserControl that contains just one TextBox . When I set
I have a custom templated control(toolbar) that contains a custom usercontrol(button) The button uses
I have a C# UserControl that hosts a TextBox. When the custom control is
I have a custom validation function in JavaScript in a user control on a
I have a custom base user control in silverlight. <UserControl x:Class=Problemo.MyBaseControl xmlns=http://schemas.microsoft.com/winfx/2006/xaml/presentation xmlns:x=http://schemas.microsoft.com/winfx/2006/xaml xmlns:d=http://schemas.microsoft.com/expression/blend/2008
I have a custom user control that contains asp:ValidationSummary . It is placed on

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.