Articles   Members Online:
-Article/Tip Search
-News Group Search over 21 Million news group articles.
-Delphi/Pascal
-CBuilder/C++
-C#Builder/C#
-JBuilder/Java
-Kylix
Member Area
-Home
-Account Center
-Top 10 NEW!!
-Submit Article/Tip
-Forums Upgraded!!
-My Articles
-Edit Information
-Login/Logout
-Become a Member
-Why sign up!
-Newsletter
-Chat Online!
-Indexes NEW!!
Employment
-Build your resume
-Find a job
-Post a job
-Resume Search
Contacts
-Contacts
-Feedbacks
-Link to us
-Privacy/Disclaimer
Embarcadero
Visit Embarcadero
Embarcadero Community
JEDI
Links
How do I change the color of the tabs on a PageControl Turn on/off line numbers in source code. Switch to Orginial background IDE or DSP color Comment or reply to this aritlce/tip for discussion. Bookmark this article to my favorite article(s). Print this article
19-Nov-02
Category
VCL-General
Language
Delphi 3.x
Views
122
User Rating
No Votes
# Votes
0
Replies
0
Publisher:
DSP, Administrator
Reference URL:
DKB
			Author: William Gerbert

How do I change the color of the tabs on a PageControl?

Answer:

The example below uses the OnDrawCell event to change the colour of the active Tab 
and of the Font used:
1   
2   procedure TForm1.TabControl1DrawTab(Control: TCustomTabControl;
3     TabIndex: Integer; const Rect: TRect; Active: Boolean);
4   var
5     s: string;
6     r: TRect;
7   begin
8     s := form1.TabControl1.Tabs.Strings[tabindex];
9     r := Rect;
10    with Control.Canvas do
11    begin
12      if Active then
13      begin
14        Brush.Color := clinfoBK;
15        Font.Color := clBlue;
16      end;
17      Windows.FillRect(Handle, r, Brush.Handle);
18      OffsetRect(r, 0, 1);
19      DrawText(Handle, PChar(s), Length(s), r, DT_CENTER or DT_SINGLELINE or
20        DT_VCENTER);
21    end;
22  end;


			
Vote: How useful do you find this Article/Tip?
Bad Excellent
1 2 3 4 5 6 7 8 9 10

 

Advertisement
Share this page
Advertisement
Download from Google

Copyright © Mendozi Enterprises LLC