Reputation: 84650
I built a custom control, and with theme support on it looks very strange. Is there any way to make it so that it will always draw with themes off, even if the application is built with theme support on?
EDIT: I found a way to turn theming off and it didn't help much. The problem is that it's a special button descended from TBitBtn, and whenever the button is selected, it tries to draw a border around it with a dotted line and that gets in the way. How can I turn that off?
Upvotes: 0
Views: 366
Reputation: 47819
You can try to copy the implementation of TBitBtn.DrawItem and tweak it to your needs. A search for IsFocused inside the code should give you a guide.
To call your patched code you also have to link in the CNDrawItem method by implementing a similar message handler.
Upvotes: 3
Reputation: 1464
u can disable the theme for a component using the SetWindowTheme
function found in UxTheme.pas
this will disable the theme for a button and a progressbar
...
SetWindowTheme(Button.Handle, ' ', ' ');
SetWindowTheme(ProgressBar.Handle, ' ', ' ');
...
Upvotes: 0