Reputation: 597
OS: Windows XP Pro SP3
Issue:
As you see - in left side is located StatusBar Control ; In right side - TabSet Control.
What approach you would suggest to "copy" StatusBar style ( dynamic darkening of Top and Button ) into TabSet Control? Colour manipulations like clNone or AlphaBlend do not work ... and TransparentColor prop is not available either ...
Again I am too puzzled because there is a lot of options ( imho ) to choose from, but I do not know possible side-effects and level of compatibility in various Windows versions.
Thank you very very very much for any help.
P.S. Sorry if it is hard to notice issue I am experiencing in my little image above, BUT if I would resize it, It would lose quality and there might be problems notice anything at all ..
Rephrasing the Question
StatusBar1 is Parent of TabSet1. Now it looks like this ( wrong ):
I must achieve this StatusBar1.Panels[0] and TabSet1 look ( correct ):
I also tried to use psOwnerDraw technique ( http://delphi.about.com/od/vclusing/a/statusbar_owner.htm ) for StatusBar1.Panels[0] and get this result:
Upvotes: 0
Views: 859
Reputation: 13991
I tried the following in Turbo Delphi:
Add the following OnCreate handler:
procedure TForm1.FormCreate(Sender: TObject);
begin
StatusBar1.SimplePanel := True;
StatusBar1.SimpleText := 'Hallo';
TabSet1.Tabs.Add('Code');
TabSet1.Tabs.Add('History');
TabSet1.SetBounds(30, 0, TabSet1.Width, StatusBar1.Height); // Replace the 204
TabSet1.ParentBackground := True;
TabSet1.SoftTop := True;
TabSet1.Style := tsSoftTabs;
TabSet1.Parent := StatusBar1;
end;
Add XPMan to Unit1's uses clause.
Is this what you want?
Upvotes: 3
Reputation: 68862
You have two basic ways to accomplish this:
Do it the way that the control you're copying does it, which means, invoke the XP Theming engine. You should be aware if you do it this way, that this effect is conditional, and only shown on systems that (a) support and (b) have themes enabled, so any user who has chosen the Windows Classic Theme (Windows 2000 era look and feel) will not see it.
Write some code to do the effects yourself. In this case, a bitmap that is carefully painted into a region on top of an owner-drawn tab. This will give you a consistent application look, but will be ignoring the users perhaps-intentional-perhaps-unintentional preferences on how the application should look.
Obviously there are tradeoffs in both approaches.
Upvotes: 0