Manish Pansiniya's Blog

.NET, C#, Javascript, ASP.NET and lots more…:)

StackPanel’s Example

with one comment

Following is the best example of using StackPanel. It is taken from unleashed. Thanks to Adam Nathan.

<CheckBox Height="18.337" HorizontalAlignment="Left" VerticalAlignment="Top" Width="173.368">
                    <Label FontWeight="Bold" Background="Blue" Foreground="White">
                        The CheckBox
                    <TextBlock Padding="10" TextWrapping="WrapWithOverflow" Width="200">
                        CheckBox is a familiar control. But in WPF, it’s not much
more than a ToggleButton styled differently!
                    <Line Stroke="Black" StrokeThickness="1" X2="200"/>
                        <StackPanel Orientation="Horizontal">
                            <Image Margin="2" />
                                <Label FontWeight="Bold">Press F1 for more help.</Label>

Following is the output of the above code. See the label, TextBlock and line are stacked vertically an Image and Help stacked horizontally. I have removed the image from it as I dont have the same.


It’s the better example of StackPanel.


Written by Manish

October 19, 2007 at 8:48 am

Posted in .NET 3.0, WPF

One Response

Subscribe to comments with RSS.

  1. I am looking to use the horizontal stackpanel but at the same time automatically load images with databinding to it.

    Can it be done?


    November 16, 2007 at 7:15 pm

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: