一起學Windows Phone7開發(十三.四 基本控制項)

來源:互聯網
上載者:User

在這裡,把一些最基本的控制項列出來,其實也就是沒有歸類的控制項都放在這裡了。

一.TextBlock:這個控制項其實就是Label控制項。

<TextBlock x:Name="PageTitle" Text="page name" Margin="-3,-8,0,0" Style="{StaticResource PhoneTextTitle1Style}" TextWrapping="Wrap"/>Style:設定字型、字色、大小等樣式,用StaticResource方式可以綁定預設的樣式。

TextWrapping:設定是否自動換行。

Text:在控制項上要顯示的文字。

二.CheckBox:多選控制項,通過blend工具也可以產生多種效果,另外要想將選擇框加大,並不是能過設定Width,Height來完成的,而是通過RenderTransform的Scale來完成的。

<CheckBox Content="CheckBox1" Height="80" HorizontalAlignment="Left" Margin="102,113,0,0" Name="checkBox1" VerticalAlignment="Top" Width="279" BorderBrush="Red" Foreground="Blue" Checked="checkBox1_Checked" Background="Yellow"/>

    <CheckBox Content="CheckBox2" Height="72" HorizontalAlignment="Left" Margin="148,0,0,346" Name="checkBox2" VerticalAlignment="Bottom"  Checked="checkBox2_Checked" RenderTransformOrigin="0.5,0.5" BorderBrush="#BFFB2200" Foreground="#FF1008F7">

                 <CheckBox.Background>

                          <LinearGradientBrush EndPoint="0.5,1" MappingMode="RelativeToBoundingBox" StartPoint="0.5,0">

                                    <GradientStop Color="White" Offset="0.504"/>

                                    <GradientStop Color="#FFF7E306" Offset="1"/>

                                    <GradientStop Color="#FFF7E306" Offset="0.004"/>

                           </LinearGradientBrush>

                 </CheckBox.Background>

                 <CheckBox.RenderTransform>

                          <CompositeTransform ScaleX="2" ScaleY="2"/>

                 </CheckBox.RenderTransform>

            </CheckBox>

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.