Jump to content
Nathan Wild

DBNavigator Losing Colours

Recommended Posts

I am using a DBNavigator control in one of my applications and for some reason, When I place it on the form it looks fine, but as soon as I connect a datasource to it, all the buttons lose their colour.  NOTE: I don't mean they are greyed-out / inactive.  I mean where they used to show blue glyphs for the first, previous, next and last buttons, they now show grey ones.  They work normally, and grey-out as they should depending on the state of the underlying dataset, but the difference between an enabled button and a disabled on is very hard to see without the colour!

 

See the attached screen shot.  The control on the right was just dropped onto the form, but does not have its datasource property populated.  The one on the left is identical, except that it is connected to a TDataSource.

 

This is definitely the result of a VCL theme thing, but I can't find any properties that allow me to tell this control to ignore the theme (i.e. the standard "StyleElements" property)

 

Any guidance appreciated!

Screenshot 2019-05-16 13.47.36.png

Share this post


Link to post

Currently there is no way to disable themes on a per control basis that I know of.

Share this post


Link to post

Hi,

 

property StyleElements: TStyleElements read FStyleElements write SetStyleElements default 7;

Specifies the style elements that are used by the control.

Use StyleElements to customize the style of the control. If a custom style is enabled, you can enable or disable style elements in the control.

StyleElements is a set of values that specify which elements of the current style are to be applied to this control. By default, all the elements of the style are enabled.

 

But for TdbNavigator  is not possibile to set styleelements .. partial success with grids...

 

br,

M

 

Edited by mausmb

Share this post


Link to post

Good grief...  It never even occurred to me to check and see if TDBNavigator had a StyleElement property...  It is missing from the design-time inspector, so I just assumed it did not...

 

Setting DBNavigator.StyleElements := [seFont,seBorder] had the desired effect.  Thanks!

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×