[Winodows Phone 7 controls] button controls

Source: Internet
Author: User

There are multiple button controls in Silverlight, which are also well supported in Windows phone7.

I.Button: This control is just a basic control. You can use blend to create buttons with multiple effects.

            <Button Content="Button1" Height="81" HorizontalAlignment="Left" Margin="135,45,0,0" Name="button1" VerticalAlignment="Top" Width="213" Click="button1_Click"  Background="Blue" Foreground="Beige" BorderBrush="Yellow" BorderThickness="5"  />
<Button Content="Button2" Height="81" HorizontalAlignment="Left" Margin="135,132,0,0" x:Name="button2" VerticalAlignment="Top" Width="213" Foreground="Beige" BorderBrush="Yellow" BorderThickness="5" >
<Button.Background>
<LinearGradientBrush EndPoint="0.5,1" MappingMode="RelativeToBoundingBox" StartPoint="0.5,0">
<GradientStop Color="#FF000000" Offset="0.543"/>
<GradientStop Color="#FFFFFFFF" Offset="0.996"/>
<GradientStop Color="Red" Offset="0.03"/>
</LinearGradientBrush>
</Button.Background>
</Button>
<Button Content="Button3" Height="81" HorizontalAlignment="Left" Margin="135,219,0,0" x:Name="button3" VerticalAlignment="Top" Width="213" Foreground="Beige" BorderBrush="Yellow" BorderThickness="5" ClickMode="Press" >
<Button.Background>
<ImageBrush ImageSource="Images/1.jpg" Stretch="UniformToFill"/>
</Button.Background>
</Button>

II.Hyperlinkbutton: Hyperlink button, which can be navigate local and web.

HyperlinkButton Content="Click here to learn about Silverlight"
NavigateUri="http://www.silverlight.net" TargetName="_blank" Margin="22,270,-12,239"/>

Navigateuri: If the targetname attribute is not specified, the link of relative can only be used.

III.Repeatbutton: Click events can be triggered continuously after being pressed. In this way, you can complete the constantly changing needs, such as turning pages and moving.

<RepeatButton Content="RepeatButton" Height="100" HorizontalAlignment="Left" Margin="84,374,0,0" Name="repeatButton1" VerticalAlignment="Top" Width="315"  Click="repeatButton1_Click"/>           

4.Togglebutton:Trigger buttonThe buttons can be in two States (checked, unchecked) or three other States (one more indeterminate state ).

<ToggleButton  Content="ToggleButton" Height="127" HorizontalAlignment="Left" Margin="103,474,0,0" Name="toggleButton1" VerticalAlignment="Top" Width="268" IsThreeState="True" Checked="toggleButton1_Checked" Unchecked="toggleButton1_Unchecked"  Indeterminate="toggleButton1_Indeterminate"/>

Isthreestate: Set whether there are three statuses

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

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.