Get rid of button border in WPF?

后端 未结 4 2021
长情又很酷
长情又很酷 2020-12-03 05:33

i am trying to get rid of button border and only display text, however a thin line around the text gets displayed even though i set borderThickness to 0 and borderbrush to t

4条回答
  •  有刺的猬
    2020-12-03 05:52

    You need to create a new Template for your buttons.

    The easiest way to do this is open your project in Expression Blend, select the button and then right click and select "Edit Template > Edit a Copy..". This copies the existing template into one you can modify. It's easier if you create it in a resource dictionary.

    Then select the template and on the Resource tab (on the right of the UI) select the ButtonFocusVisual. Select the Properties tab and expand the Miscellaneous section. This has BorderStyle and BorderThickness fields (among others). Set the style to None.

提交回复
热议问题