WIN10 series: C # App Control Basics 2

Source: Internet
Author: User

Hyperlinkbutton controls

The Hyperlinkbutton control is a button that is displayed as a hyperlink text, and you can set a URI address for its NavigateUri property, and when you click the Hyperlink text button, the URI address page defined in the Hyperlinkbutton control is opened using the browser.

In a XAML file, the use of the Hyperlinkbutton control is as follows:

- or -

<!-- Adding child elements -

</HyperlinkButton>

- or -

<!-- Add a String -

</HyperlinkButton>

The following describes the common properties of the Hyperlinkbutton control:

    • The content property, Gets or sets the text contents of the Hyperlinkbutton control.
    • Foreground property, Gets or sets the text color of the Hyperlinkbutton control.
    • NavigateUri property, Gets or sets the URI address to navigate to another page when you click the Hyperlinkbutton control.

Next, a sample demonstrates how to use the NavigateUri property of the Hyperlinkbutton control. Create a new Windows store blank application project and name Hyperlinkbuttondemo to add the following code to the grid element of the MainPage.xaml file.

Click to learn more about Microsoft "fontsize=" foreground= "white" navigateuri= "http://www.microsoft.com/zh-cn/default.aspx" margin= " 101,405,0,292 "height="/>

The above code defines the NavigateUri property value of the Hyperlinkbutton control as http://www.microsoft.com/zh-cn/ Default.aspx, when you click the Hyperlinkbutton control to display the hyperlink text, the browser opens the URI address page of the NavigateUri property setting.

start debugging, as shown in result 4-3. After clicking the "click to learn more Microsoft Information" hyperlink text, the browser will open the Microsoft China Official website page, shown in 4-4.

Figure 4-3 The use of the NavigateUri attribute figure 4-4 Microsoft China Official website page

WIN10 series: C # App Control Basics 2

Related Article

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.