WPF control hints-button: In addition to custom templet, how to conveniently implement a borderless button

Source: Internet
Author: User

In the project, we need a button with a border. Generally, we use a custom templet to do this. In fact, if there is no special need for other functions, we can implement this point more simply.

<ButtonContent= "Borderless button"Style="{Staticresource {X: static toolbar. buttonstylekey }}" />

Someone will use borderbrush = "{X: NULL}" background = "{X: NULL}" to make the button look like there is no border. The problem is: 1. at this time, the borderless effect is related to the topic. If there is no border in the window classic topic, but there will still be a border shadow area under the windowxp topic. 2. Further, even if you only click the button under the window classic topic, the shadow border with the concave effect will still be generated.

Most of the time, you can simply use the built-in toolbar. buttonstylekey to achieve the desired effect. As for more complex display requirements, WPF's powerful and flexible templet is a good solution.

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.