control in user control to adjust with size

D

David C

I have a datagrid control encapsulated inside a user control. When I use
the user control on a form and change its size, is there a way to get the
datagrid inside the user control to adjust with it accordingly?

Thanks.
 
K

Kevin Spencer

There are about a half-dozen ways. You can use the Anchor property to attach
the Control to one or more sides of its container, which causes that side to
remain at the same distance from the edge of the container when the
container changes size. You can use Docking to dock the child control to the
top, bottom, left, or right side, and that behavior is different than the
Anchor behavior. You can put the Control into a Container Control such as a
SplitPanel, Panel, etc., and use its relationship to the Container combined
with the Container's relationship to its Container. You can handle resizing
events and assign values to the Location and/or Size of the Control.

--
HTH,

Kevin Spencer
Microsoft MVP
Professional Chicken Salad Alchemist

Big thicks are made up of lots of little thins.
 

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