简体   繁体   中英

How do I change the style of a tab control after it has been created?

I have a Windows form ( not a WPF form) that contains a tab control from CommCtrl.h. According to the documentation , I should be able to change the "style" to TCS_BUTTONS after the control has been created. Unfortunately, I can't find any examples on how to do that. Can anyone provide a reference to C++ or VB6 code to do this?

More specifically, I'm using PowerBuilder 11.5 which wraps the native MS tab control. PowerBuilder doesn't expose the TCS_BUTTONS style but I'm looking for a way to send the raw messages to change the style anyway to get around this PowerBuilder limitation.

I'm not sure about the PowerBuilder angle but if you want to add a flag in the style of a control try this:

DWORD dwStyle = ::GetWindowLong(hWnd, GWL_STYLE);
dwStyle |= TCS_BUTTONS;

::SetWindowLong(hWnd, GWL_STYLE, dwStyle);

You can use the same sort of concept to remove a style, eg

dwStyle &= ~dwRemove;

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM