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 to remove the border of a TPageControl 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
24-Jan-03
Category
VCL-General
Language
Delphi 2.x
Views
146
User Rating
No Votes
# Votes
0
Replies
0
Publisher:
DSP, Administrator
Reference URL:
DKB
			Author: Lou Adler

How to remove the border of a TPageControl

Answer:

{TPageControlEx component
Copyright (c) 1998 Sigbjoern Revheim, Sigbjoern@mad.scientist.com
This component removes the border of the pagecontrol only if there are one ore more 
tabs.}

1   unit PageControlEx;
2   
3   interface
4   
5   uses
6     Windows, Messages, Classes, CommCtrl, ComCtrls, Controls;
7   
8   type
9     TPageControlEx = class(TPageControl)
10    private
11      FThickFrame: Boolean;
12      procedure SetThickFrame(const Value: Boolean);
13    protected
14      procedure WndProc(var Msg: TMessage); override;
15      procedure CreateParams(var Params: TCreateParams); override;
16    public
17      constructor Create(AOwner: TComponent); override;
18    published
19      property ThickFrame: Boolean read FThickFrame write SetThickFrame default true;
20    end;
21  
22  procedure register;
23  
24  implementation
25  
26  procedure register;
27  begin
28    RegisterComponents('Extra', [TPageControlEx]);
29  end;
30  
31  constructor TPageControlEx.Create(AOwner: TComponent);
32  begin
33    inherited;
34    FThickFrame := True;
35    {DoubleBuffered := True;}
36    ParentBackground := False;
37  end;
38  
39  procedure TPageControlEx.CreateParams(var Params: TCreateParams);
40  begin
41    inherited;
42    {BorderWidth := 0;}
43    {Params.Style := Params.Style or WS_POPUP;}
44    ParentBackground := False;
45  end;
46  
47  procedure TPageControlEx.SetThickFrame(const Value: Boolean);
48  begin
49    if FThickFrame <> Value then
50    begin
51      FThickFrame := Value;
52      RecreateWnd;
53    end;
54  end;
55  
56  procedure TPageControlEx.WndProc(var Msg: TMessage);
57  begin
58    inherited WndProc(Msg);
59    if not FThickFrame and (Msg.Msg = TCM_ADJUSTRECT) then
60      with PRect(Msg.LParam)^ do
61      begin
62        Left := 0;
63        Right := ClientWidth;
64        Top := Top - 8;
65        Bottom := ClientHeight;
66      end;
67  end;
68  
69  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