Articles   Members Online: 3
-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 hide and show controls by name during run time 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
06-Sep-05
Category
OO-related
Language
Delphi 4.x
Views
182
User Rating
No Votes
# Votes
0
Replies
0
Publisher:
DSP, Administrator
Reference URL:
			1   
2   unit Unit1;
3   
4   interface
5   
6   uses
7     Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
8     Dialogs, StdCtrls;
9   
10  type
11    TForm1 = class(TForm)
12      Memo1: TMemo;
13      Button1: TButton;
14      procedure Button1Click(Sender: TObject);
15      procedure Button2Click(Sender: TObject);
16    private
17      { Private declarations }
18      procedure ShowHideComponent(ComponentName: string;bShow:boolean);
19    public
20      { Public declarations }
21    end;
22  
23  var
24    Form1: TForm1;
25  
26  implementation
27  
28  {$R *.dfm}
29  
30  procedure TForm1.ShowHideComponent(ComponentName: string;bShow:boolean);
31  var
32    TmpComp: TComponent;
33  begin
34    TmpComp := FindComponent(ComponentName);
35    if TmpComp <> nil then
36      if TmpComp is TControl then  begin
37         if bShow then
38         TControl(TmpComp).Show
39         else
40         TControl(TmpComp).Hide;
41        end
42  end;
43  
44  procedure TForm1.Button1Click(Sender: TObject);
45  begin
46  
47    ShowHideComponent('MEMO1',false);
48  end;
49  
50  procedure TForm1.Button1Click(Sender: TObject);
51  begin
52  
53    ShowHideComponent('MEMO1',true);
54  end;
55  
56  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