How to get rounded corners

Editors for WPF Forum

Posted 3 years ago by Michael Bayer
Version: 16.1.0631
Avatar

Hello,

is it possible to get rounded corners in textboxes, listboxes, comboboxes, buttons etc?

Thanks in advance.

Michael

Comments (3)

Posted 3 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Hi Michael,

Yes our theming system fully supports that, assuming you have native control theming enabled on our ThemeManager.  If you add lines like this in your Application.Resources, it should work:

<CornerRadius x:Key="{x:Static themes:AssetResourceKeys.ButtonBorderNormalCornerRadiusKey}">2</CornerRadius>
<CornerRadius x:Key="{x:Static themes:AssetResourceKeys.EditBorderNormalCornerRadiusKey}">2</CornerRadius>
<CornerRadius x:Key="{x:Static themes:AssetResourceKeys.ListItemBorderNormalCornerRadiusKey}">2</CornerRadius>


Actipro Software Support

Posted 3 years ago by Michael Bayer
Avatar

Thank you. That works.

Is it possible to set the CornerRadius in Code (preferred) or bind CornerRadius to a property? I don't want to set a fix CornerRadius in code but let the user decide.

 

KR

Michael

Posted 3 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Many of the usage scenarios of those corner radius properties will assign those values to a built-in CornerRadius property on a control.  If the control doesn't have a dedicated CornerRadius property, we use an attached themes:ThemeProperties.CornerRadius property instead.  That is only for control themes that support a corner radius.


Actipro Software Support

The latest build of this product (v2018.1 build 0675) was released 14 days ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.