|
| Making TabControls work on XP with Delphi 4 |  
|
|---|
| Another Transparent Tabsheet Solution | Product: Delphi all versions | Category: VCL-General | Skill Level:
 | Scoring:  | Last Update: 04/10/2002 | Search Keys: delphi delphi3000 article borland vcl code-snippet Transparent Tabsheet Tabsheets TabControl TabControls XP WinXP Windows-XP WindowXP GetWindowLong SetWindowLong WS_EX_TRANSPARENT GWL_EX_STYLE | Times Scored: 3 | Visits: 3823 | Uploader: John W. Long Company: | Reference: N/A | | | Question/Problem/Abstract:
Matteo Riso posted an solution for creating transparent Tabsheets in his article http://www.delphi3000.com/articles/article_2843.asp, unfortunately it does not work for Delphi 4. The solution is described below. | Answer:
{
Before I begin I should mention that you will need
to enable XP theming by adding a manifest to your
own project. An easy way to do this is either
through the TWinXP component (mentioned in Matteo's
article) or through Jordan Russell's XPTheme.pas
which can be downloaded from the misc section on:
http://www.jrsoftware.org/
That should be it for starters! Now add a new
event procedure to the delphi form that
contains the TabControl:
}
TfrmOptions = class(TForm)
...
procedure SetTransparent(Sender: TObject); { <<< }
private
{ Private declarations }
...
public
{ Public declarations }
...
end;
{
Now add the procedure definition at the end of
your form's unit:
}
procedure TMyForm.SetTransparent(Sender: TObject);
var
style : integer;
begin
if Sender is TWinControl then
with Sender as TWinControl do
begin
style := GetWindowLong(Handle,GWL_EXSTYLE);
if not ((style or WS_EX_TRANSPARENT) = style) then
SetWindowLong(Handle,GWL_EXSTYLE,
style or WS_EX_TRANSPARENT);
end;
end;
{
Now click on each TabSheet (TabSheet as opposed to
the TabControl itself) and set its OnShow Event to
SetTransparent.
That should do the trick.
}
|
|
|
| |
Sign up to consume product discounts for Bronze memberships !
|
|
| |
Community Ad of C.A. Longen |
|
| |
|
|
|