newbie form question

  • Thread starter Thread starter Stephanie_Stowe
  • Start date Start date
S

Stephanie_Stowe

I have a form with a treeview on it. This form also has a user control.
This user control has a panel with controls in it (a couple of textboxes
and a ComponentOne TrueDB Grid). It is lovely. Except that when I resize
the form, the panel does not present scrollbars. I have the panel's
autoscroll property set to true. I went into the user control in the
designer. If I resize the panel itself, the scrollbars automatically
appear. And that is lovely. If I resize the control itself, the scrollbars
do not appear. This makes sense to me. The panel does not know it's
container was resized. How do I tell it?

Thanks

Stephanie
 
Did you set the Anchor property of Panel to (AnchorStyles.Top |
AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right) ?

I suppose if you set this property correctly you'll get rid of your
problem. In this case Panel will follow the parent (user control) size.
 
Well now, didn't I just learn something. I set the Anchor property of the
panel. Then I set the Anchor property of the user control on the form. And
voila. It works like a charm. I read the Anchor property help, and it
makes perfect sense. Thanks for the direction!
 
Back
Top