Problem with changing some brushes

WPF Studio, Themes, and Shared Library for WPF Forum

Posted 1 year ago by Mike
Version: 17.2.0665
Platform: .NET 4.7
Environment: Windows 10 (64-bit)
Avatar

Hi,

I'm trying to change the background color of the non-editable combobox but it appears that it's bound to Button background. Is there a way to simply change the color in a resource dictionary without recreating the combobox style completely?

Also I was trying to change the border color of the textbox when it's focused since there is no visual indicator yet. But again there is no brush for it to override. Would it be possible to simply change this as well without recreating a textbox style completely?

I'd have been nicer if each control has its own brushes to override instead of button brush also effects combobox etc. And it makes guessing which brush affects which part of the control easier. It took me a lot of time to find the depending brushes.

Comments (3)

Posted 1 year ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Hello,

If you are using native control theming, I believe non-editable ComboBoxes have AssetResourceKeys.EditBackgroundNormalBrushKey set as the default background.  That shouldn't be bound to Button at all.  AssetResourceKeys.EditBorderFocusedBrushKey is used when the TextBox is focused.

If you are a licensed customer of WPF Studio, you can download the default styles/templates right from your account.  If you've licensed individual products instead, you can email our support to request the default style/templates for the products you won.  Those make it easy to see what brushes are used where.


Actipro Software Support

Posted 1 year ago by Mike
Avatar

The AssetResourceKeys.EditBackgroundNormalBrushKey changes the background color of the textboxes etc but the non-editable ComboBox color remains the same. Instead changing the AssetResourceKeys.ButtonBackgroundNormalBrushKey changes the combobox background color.

Posted 1 year ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Ahh yes sorry, after looking deeper into the template hierarchy, the "button" portion of the non-editable ComboBox covers the entire control so it covers up the EditBackgroundNormalBrushKey area.


Actipro Software Support

The latest build of this product (v2019.1 build 0682) was released 0 days ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.