Visual Basic (Declaration) | |
---|---|
Public Overloads Sub CenterPart( _ ByVal part As Part, _ ByVal afterwards As Action _ ) |
C# | |
---|---|
public void CenterPart( Part part, Action afterwards ) |
Parameters
- part
- afterwards
- an
Action
to be performed after the animation is finished; may be null
The HorizontalContentAlignment and VerticalContentAlignment properties need to be "Stretch" if the DiagramPanel.DiagramBounds are smaller than the viewport. But in any case, the part might not be centered if the panel cannot be scrolled far enough.
If you just want to make sure the panel is scrolled so that a part is visible, to avoid unnecessary scrolling when the part is already visible, call MakeVisible.