Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/objective-c/22.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Windows phone 7 如何在我的应用程序中使用Windows用户电话控件_Windows Phone 7 - Fatal编程技术网

Windows phone 7 如何在我的应用程序中使用Windows用户电话控件

Windows phone 7 如何在我的应用程序中使用Windows用户电话控件,windows-phone-7,Windows Phone 7,例如,我想在我的网格中添加一个像stack panel这样的用户控件 -在MainPage.xaml中命名内容面板的网格 -列表项 -位于usercontrol.xaml中的堆栈面板 <UserControl x:Class="USER.WindowsPhoneControl1" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.micro

例如,我想在我的网格中添加一个像stack panel这样的用户控件

-在MainPage.xaml中命名内容面板的网格 -列表项

-位于usercontrol.xaml中的堆栈面板

 <UserControl x:Class="USER.WindowsPhoneControl1"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Loaded="UserControl_Loaded">
    <StackPanel HorizontalAlignment="Center">

        <StackPanel.Resources>
            <!--Create a Style for a TextBlock.-->
            <Style TargetType="TextBlock" x:Key="TextBlockStyle">
                <Setter Property="Foreground" Value="Navy"/>
                <Setter Property="FontSize" Value="14"/>
                <Setter Property="VerticalAlignment" Value="Bottom"/>
            </Style>

            <!--Create a Style for a TextBlock.-->
            <Style TargetType="TextBox" x:Key="TextBoxStyle">
                <Setter Property="Width" Value="200"/>
                <Setter Property="Height" Value="30"/>
                <Setter Property="Margin" Value="4"/>
                <Setter Property="FontSize" Value="14"/>
                <Setter Property="Background" Value="Blue"/>
            </Style>
        </StackPanel.Resources>

        <TextBlock FontSize="18" Text="Enter your name." Name="abc" />
        <StackPanel   Orientation="Horizontal" Name="sta">
            <TextBlock Style="{StaticResource TextBlockStyle}">
                First Name:
            </TextBlock>
            <TextBox Name="firstName" Style="{StaticResource TextBoxStyle}"/>
        </StackPanel>
        <StackPanel Orientation="Horizontal">
            <TextBlock Style="{StaticResource TextBlockStyle}">
                Last Name:
            </TextBlock>
            <TextBox Name="lastName" Style="{StaticResource TextBoxStyle}"  
                     Margin="6,4,4,4"/>
        </StackPanel>
        <Button Width="50" Content="Submit" Click="Button_Click"/>

    </StackPanel>
</UserControl>

名字:
姓氏:
我想在网格中添加堆栈面板


thanx提前

我不能100%确定你在问什么问题,但完全可以将StackPanel放在:


<Grid>
    <StackPanel />
</Grid>