在这一天的学习中我学会了WP7编程上的控件应用,Grid(网格特点),canvas(画布),stackpanel,Grid.row,Grid.column,horizontalAlignment,verticalAlignment,content,width,height,stretch,rowdefinition,columndefinition,ScrollViewer    ,grid.columnspan,grid.rowspan

等属性的用法

<!--LayoutRoot is the root grid where all page content is placed-->
    <Grid x:Name="LayoutRoot" Background="Transparent">
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="*"/>
        </Grid.RowDefinitions>

        <!--TitlePanel contains the name of the application and page title-->
        <StackPanel x:Name="TitlePanel" Grid.Row="0" Margin="12,17,0,28">
            <TextBlock x:Name="ApplicationTitle" Text="MY APPLICATION" Style="{StaticResource PhoneTextNormalStyle}"/>
            <TextBlock x:Name="PageTitle" Text="page name" Margin="9,-7,0,0" Style="{StaticResource PhoneTextTitle1Style}"/>
        </StackPanel>
        <!--<ScrollViewer Margin="0,175,0,0"
                      Height="500"
                      VerticalScrollBarVisibility="Visible">-->
     

        <!--ContentPanel - place additional content here-->
        <Grid x:Name="ContentPanel" Grid.Row="1" Margin="12,0,12,0">
            <Grid.RowDefinitions>
                <RowDefinition Height="75*"/>
                <RowDefinition Height="75*"/>
                <RowDefinition Height="75*"/>
                <RowDefinition Height="75*"/>
                <RowDefinition Height="75*"/>
                <RowDefinition Height="75*"/>
                <RowDefinition Height="75*"/>
                <RowDefinition Height="75*"/>
                </Grid.RowDefinitions>
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="160*"/>
                <ColumnDefinition Width="50*"/>

                <ColumnDefinition Width="250*"/>
            </Grid.ColumnDefinitions>
            <TextBox Name="myTextBox"
                 Width="250"
                 Height="70"
                 Grid.Column="2"
                 Grid.Row="0"
                 HorizontalAlignment="Stretch"
                 VerticalAlignment="Stretch"
               />
            <CheckBox Name="myCheckBox"
                      Content="Are you sure ???"
                      Grid.ColumnSpan="3"
                      Grid.Row="2"
                      HorizontalAlignment="Stretch"
                      VerticalAlignment="Stretch"
                      Checked="myCheckBox_Checked"/>
           <PasswordBox Name="myPasswordBox"
                        Width="250"
                        Height="70"
                        Grid.Column="2"
                        Grid.Row="1"
                        HorizontalAlignment="Stretch"
                        VerticalAlignment="Stretch"
                        PasswordChanged="myPasswordBox_PasswordChanged"/>
            <RadioButton Name="myRadioButtun1"
                         Content="Male"
                         Grid.Column="2"
                         Grid.Row="3"
                         HorizontalAlignment="Stretch"
                         VerticalAlignment="Stretch"
                         GroupName="myGroup"
                         IsChecked="True"/>
            <RadioButton Name="myRadioButtun2"
                         Content="Femal"
                         Grid.Column="2"
                         Grid.Row="4"
                         HorizontalAlignment="Stretch"
                         VerticalAlignment="Stretch"
                         GroupName="myGroup"/>
            <ListBox Name="myListBox"
                     Grid.Row="5"
                     Grid.Column="0"
                     Grid.RowSpan="2"
                     SelectionChanged="myListBox_SelectionChanged">
                <ListBoxItem Content="First option"/>
                <ListBoxItem Content="Second option"/>
                <ListBoxItem Content="Third option"/>
                <ListBoxItem Content="Forth option"/>
                <ListBoxItem Content="Fifth option"/>
                <ListBoxItem Content="Sixth option"/>
                <ListBoxItem Content="Seventh option"/>
                <ListBoxItem Content="Eighth option"/>
                <ListBoxItem Content="Ninth option"/>
            </ListBox>
            <Button Name="myButton"
                    Grid.Row="7"
                    Grid.Column="2"
                    Content="OK"
                    Click="myButton_Click"/>

        </Grid>
        <!--</ScrollViewer>-->

    </Grid>

 

posted on 2012-03-10 19:35  L12619  阅读(175)  评论(0编辑  收藏  举报