c# - Panel.Dock Fill ignoring other Panel.Dock setting -
if create panel on form , set dock=top , drop panel , set dock=fill, may fill entire form, ignoring first panel. changing tab order nothing.
docking layout depends on order of sibling controls. controls docked "button up", last control in collection docked first. docked control take layout of previously docked siblings account. hence control dock=fill should first (top) in sibling order, if want take other docked controls account. if not first control, earlier controls overlap it.
this can confusing because sibling-order not same visual order, , sibling order not apparent design view.
the document outline window (view -> other windows -> document outline) gives useful tree-view on control hierarchy , order, , allows change sibling order of controls.
you can change sibling order directly in designer context menu -> bring front / send back, moves control first or last of siblings. these menu labels may confusing since actual effect depends on layout model.
with fixed positioned controls, 2d position independent of sibling order, when controls overlapping, control earliest in order "on top", hiding part of siblings later in order. in context bring front / send makes sense.
inside flow- or table-layout panels, creation order determines visual order of controls. there no overlapping controls. bring front/send means make first or last in order of controls.
with docked layout, bring front / send may more confusing since determines in order docking calculated, "bring front" on fill-docked control place control in middle of parent, taking edge-docked controls account.
Comments
Post a Comment