实现注册参数传递

如果.net学的好,这个应该不难理解

只是用了Grid布局,然后传值还是用的传统的get方法

实现页面侧面翻转只是更改一个属性SupportedOrientations="PortraitOrLandscape"

当实现了页面的翻转还是不能移动,怎么办呢,加一个ScrollViewer就OK 了

View Code
 1       <Grid x:Name="ContentPanel" Margin="12,156,12,28" ScrollViewer.HorizontalScrollBarVisibility="Auto" Grid.RowSpan="2">
 2             <Grid.RowDefinitions>
 3                 <RowDefinition Height="100"></RowDefinition>
 4                 <RowDefinition Height="100"></RowDefinition>
 5                 <RowDefinition Height="100"></RowDefinition>
 6                 <RowDefinition Height="100"></RowDefinition>
 7                 <RowDefinition Height="100"></RowDefinition>
 8                 <RowDefinition Height="107*" />
 9             </Grid.RowDefinitions>
10             <Grid.ColumnDefinitions>
11                 <ColumnDefinition Width="150"></ColumnDefinition>
12                 <ColumnDefinition Width="306*" />
13             </Grid.ColumnDefinitions>
14             <TextBlock Height="78" HorizontalAlignment="Left" Name="textBlock1" Text="姓名:" VerticalAlignment="Top" Width="150" TextAlignment="Center" FontSize="36" Margin="0,22,0,0" />
15             <TextBox Height="76" HorizontalAlignment="Left" Margin="0,6,0,0" Name="textBox1" Text="" VerticalAlignment="Top" Width="281" Grid.Column="1" />
16             <TextBlock Grid.Row="1" Height="83" HorizontalAlignment="Left" Margin="28,6,0,0" Name="textBlock2" Text="密码:" FontSize="40" VerticalAlignment="Top" Width="107" />
17             <TextBlock FontSize="40" Height="83" HorizontalAlignment="Left" Margin="28,17,0,0" Name="textBlock3" Text="性别:" VerticalAlignment="Top" Width="107" Grid.Row="2" />
18             <TextBlock FontSize="40" Height="83" HorizontalAlignment="Left" Margin="28,17,0,0" Name="textBlock4" Text="城市:" VerticalAlignment="Top" Width="107" Grid.Row="3" />
19             <PasswordBox Grid.Column="1" Grid.Row="1" Height="67" HorizontalAlignment="Left" Margin="0,8,0,0" Name="passwordBox1" VerticalAlignment="Top" Width="281" />
20             <RadioButton Content="" Grid.Column="1" Grid.Row="2" Height="83" HorizontalAlignment="Left" Margin="26,9,0,0" Name="radioButton1" VerticalAlignment="Top" Width="101" />
21             <RadioButton Content="" Grid.Column="1" Grid.Row="2" Height="78" HorizontalAlignment="Left" Margin="153,9,0,0" Name="radioButton2" VerticalAlignment="Top" Width="112" />
22             <TextBlock FontSize="40" Height="83" HorizontalAlignment="Left" Margin="28,17,0,0" Name="textBlock5" Text="爱好:" VerticalAlignment="Top" Width="107" Grid.Row="4" />
23             <CheckBox Content="网球" Grid.Column="1" Grid.Row="4" Height="72" HorizontalAlignment="Left" Margin="0,17,0,0" Name="checkBox1" VerticalAlignment="Top" />
24             <CheckBox Content="篮球" Height="72" HorizontalAlignment="Left" Margin="120,15,0,0" Name="checkBox2" VerticalAlignment="Top" Grid.Column="1" Grid.Row="4" />
25             <Button Content="注册" Grid.ColumnSpan="2" Grid.Row="5" Height="72" HorizontalAlignment="Left" Margin="134,12,0,0" Name="button1" VerticalAlignment="Top" Width="160" Click="button1_Click" />
26             <TextBox Height="76" HorizontalAlignment="Left" Margin="0,17,0,0" Name="textBox2" Text="" VerticalAlignment="Top" Width="281" Grid.Row="3" Grid.Column="1" />
27             </Grid>
28        
29     </Grid>
30     </ScrollViewer>

 

 

posted @ 2012-11-02 23:00  qinpei  阅读(231)  评论(0编辑  收藏  举报