简体   繁体   English

XAML WP8中的内联对象位置

[英]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 . 我想在XAML WP8中使checkboxtextbloxk平行或内联,但是似乎checkbox处于上升状态,而textblock位于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. 您不需要TextBlock Set CheckBox.Content : 设置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上设置Orientation="Horizontal"

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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