Mark Williams 14 Posted 21 hours ago (edited) I'm working on a component derived from a TTabControl. I want to manipulate the individual tabs in various ways. To do so I need to override the DrawTab event. This works well until you activate a theme and then the DrawTab event doesn't fire unless you disable seClient for styleElements., which I don't wish to do as I don't want to have to try and draw the body. If I add a TTabControl to a form and then access its OnDrawTab event, I can override the themed drawing of the tab with a theme active even though seClient styleElements is true. That seems a bit odd to me. I have tried catching various paint messages and tab drawing messages, but nothing seems to fire in my custom control with seClient set to true. Is there a way of doing this? Edited 21 hours ago by Mark Williams Share this post Link to post
PeterBelow 253 Posted 9 hours ago 11 hours ago, Mark Williams said: I'm working on a component derived from a TTabControl. I want to manipulate the individual tabs in various ways. To do so I need to override the DrawTab event. This works well until you activate a theme and then the DrawTab event doesn't fire unless you disable seClient for styleElements., which I don't wish to do as I don't want to have to try and draw the body. If I add a TTabControl to a form and then access its OnDrawTab event, I can override the themed drawing of the tab with a theme active even though seClient styleElements is true. That seems a bit odd to me. I have tried catching various paint messages and tab drawing messages, but nothing seems to fire in my custom control with seClient set to true. Is there a way of doing this? Try to add a class constructor and destructor to your custom control, like class constructor TMyTabControl.Create; begin TCustomStyleEngine.RegisterStyleHook(TMyTabControl, TTabControlStyleHook); end; class destructor TMyTabControl.Destroy; begin TCustomStyleEngine.UnRegisterStyleHook(TMyTabControl, TTabControlStyleHook); end; Of course you need to use your component class name instead of TMyTabControl. Share this post Link to post