StackPanel Example

The StackPanel control may stack child Framework Elements either vertically or horizontally. This Orientation is set in the Initialize method:

myStkPanel.Initialize(200, 100, ContainerType.Canvas, Orientation.Horizontal);

Moreover, you may opt to change/override this Orientation of the Parent at any time while adding Composites by defining a StackPanelArgs argument, passing it in to the EndComposite call:

.EndComposite<StackPanel, StackPanelArgs>(new StackPanelArgs(Orientation.Horizontal));

Similar to the StackPanel IParent is the StackPanel container type for Composites. However, the Orientation for container types is defined separately inherent in the name itself, either ContainerType.HorizontalPanel OR ContainerType.VerticalPanel respectively.

Last edited Apr 1, 2014 at 6:57 AM by stagathome0069, version 4


No comments yet.