newbie form question

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
 
M

Mikhail Fedosov

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.
 
S

Stephanie_Stowe

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!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top