control in user control to adjust with size

  • Thread starter Thread starter David C
  • Start date Start date
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.
 
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.
 
Back
Top