delphi3000.com - the free delphi knowledge platform
delphi3000.com - the free delphi knowledge platform
Have a look at your member-status

connecting people's knowledge


  - Recent ArticlesRSS feed for Recent Articles on delphi3000.com
  - List of All Articles
  - Top Viewed Articles
  - Articles (+Attachem.)
  - Articles Of Interest
  - Categories
  - Top Uploader
  - Search
  - Index

  - My Home
  - Submit an Article
  - My Articles
  - My Personal Data
  - My Bookmarks
  - Activities
  - Login/Logout

  - Sign Up
  - Why Sign Up
  - Newsletter

  - Press
  - Advertise

  - Contact
  - Feedback



Community
Borland
ClubeDelphi
Dr. Bob
UK-BUG
Delphi Meetings
Planeta Delphi








Share this article with friendsShare this article with friends
Rate this articleRate this article - to keep the quality of delphi3000.com !
Comment this article or read through previous comments (0)


Making TabControls work on XP with Delphi 4Go to John W. Long's websiteFormat this article printer-friendly!Bookmark function is only available for registered users!
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.
}





Please rate this article!
Skill level:
BeginnerExpert

Useful:
No!Very!

Overall rating:
PoorExcellent



Comments to this article
Write a new comment













 
Sign up to consume product discounts for Bronze memberships !

read more


   


  Community Ad of
C.A. Longen
 
   














 







     
  Copyright © 2000 - 2007 delphi3000.com - All rights reserved. Terms of use. || Privacy
delphi3000.com is a service by bluestep.com IT-Services GmbH (Vienna)