简体   繁体   中英

Inline object position in XAML WP8

I want to make checkbox and textbloxk parallel or inline in my XAML WP8, but it seems the checkbox is upside and the textblock is below the checkbox . Any suggest how?

<Grid Margin="0,522,0,0" VerticalAlignment="Top" HorizontalAlignment="Left">
                            <StackPanel HorizontalAlignment="Center">

                                <CheckBox  x:Name="Accept"/>
                                <TextBlock  Text="I Accept Terms and Conditions" VerticalAlignment="Top"/>
                            </StackPanel>
                        </Grid>

You don't need TextBlock for this. Set CheckBox.Content :

<CheckBox x:Name="Accept" Content="I Accept Terms and Conditions"/>

and for other cases if want to stack elements horizontally then set Orientation="Horizontal" on you StackPanel

<StackPanel HorizontalAlignment="Center" Orientation="Horizontal">

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM