How to get rounded corners

Editors for WPF Forum

Posted 8 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 8 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 8 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 8 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 (v24.1.1) was released 1 month ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.