Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

TPageControl transparent background

Status
Not open for further replies.

rcloutie

Programmer
May 26, 2005
164
CA
Hi there,

Here's how to set a TPageControl transparent
SetWindowLong(MyPageControl.Handle, GWL_EXSTYLE, WS_EX_TRANSPARENT);

The problem is that the TabSheet also becomes transparent. The only area which need to be transparent if the rect on top-right corner (where tabs take place and where no tabs are defined).

Any idea?
 
I am wondering, will it work for any VCL component if I replace MyPageControl.Handle with the Component's Handle,because if was something similar to make a form transparent?
 
About you problem, why dont you create a second PageControl which will be above the first, won't be transparent and only the tab buttons will be visible. All you have to do is to connect the two pagecontrols so that when Active tabsheet is changed in the second tab, the first changes too.

It's a little messy solution, but it will work.

Regards,
Spent
 
New code to preserve existing style:
------------------------------------
var lStyle: LongInt;
lStyle := GetWindowLong(Handle, GWL_EXSTYLE);
SetWindowLong(Handle, GWL_EXSTYLE, lStyle and
WS_EX_TRANSPARENT);
------------------------------------

TabSheet still transparent and it shouldn't...
One precision: TabSheet is transparent only on first display, that is, when clicking on other tabs and returning back to the first one, problem is gone.

I've tried to put a TPanel over the TabSheet.
Painting is ok (TabSheet.Background=btnFace) but controls lost 3d effect...

Thanks for reply,

Rej Cloutier
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top