1

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.

Jason 'Bug' Fenter
  • 1,616
  • 1
  • 16
  • 27

1 Answers1

3

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, e.g.

dwStyle &= ~dwRemove;
snowdude
  • 3,854
  • 1
  • 18
  • 27
  • PowerBuilder doesn't have bitwise operators :( and doesn't define WinAPI constants automatically. I came up with GWL_STYLE = -16 and TCS_BUTTONS = 256. And dwStyle += TCS_BUTTONS. Unfortunately, I'm not seeing any change. – Jason 'Bug' Fenter Sep 19 '12 at 16:25
  • Using Spy++ what style does the PowerBuilder control have? – snowdude Sep 19 '12 at 19:24
  • Window 00040BAE "" PBTabControl32_100 ---- That *should* be a subclass of the standard MS control, but I don't know how to verify that. – Jason 'Bug' Fenter Sep 20 '12 at 14:07