Here,example,showing,Component,Template,will,
Quick Search for:  in language:    
Here,example,showing,Component,Template,will,
   Code/Articles » |  Newest/Best » |  Community » |  Jobs » |  Other » |  Goto » | 
CategoriesSearch Newest CodeCoding ContestCode of the DayAsk A ProJobsUpload
Delphi Stats

 Code: 174,463 lines
 Jobs: 16 postings

 
Sponsored by:

 

You are in:

 
Login



Latest Code Ticker for Delphi.
IDEAutohide
By ahmoy law on 10/25


How To Use A DLL
By Jerome Scott II on 10/24


A* Pathfinding
By Rudy van Etten on 10/24


Click here to see a screenshot of this code!Extended integer
By Josh Code on 10/23

(Screen Shot)

Any application transparent and animation
By Dashkaa on 10/22


Electronic magazine
By Rudy van Etten on 10/22


Delete Your Running Application!
By Jerome Scott II on 10/22


Word Counter
By Jerome Scott II on 10/20


J's Easy Transparent form effect
By Jason Myerscough on 10/19


Click here to put this ticker on your site!


Add this ticker to your desktop!


Daily Code Email
To join the 'Code of the Day' Mailing List click here!





Affiliate Sites



 
 
   

Component Template

Print
Email
 

Submitted on: 7/9/2000 6:14:42 PM
By:  
Level: Beginner
User Rating: By 3 Users
Compatibility:Pre Delphi 4, Delphi 4, Delphi 5

Users have accessed this article 4298 times.
 
 
     Here is an example showing how to use the Component Template. You will find it under 'Component' on the Delphi menu. Component Templates are very handy, yet very simple to use.

 
 
Terms of Agreement:   
By using this article, you agree to the following terms...   
1) You may use this article in your own programs (and may compile it into a program and distribute it in compiled format for languages that allow it) freely and with no charge.   
2) You MAY NOT redistribute this article (for example to a web site) without written permission from the original author. Failure to do so is a violation of copyright laws.   
3) You may link to this article from another website, but ONLY if it is not wrapped in a frame. 
4) You will abide by any additional copyright restrictions which the author may have placed in the article or article's description.
irst start with a blank Form. Add a Panel, and set Panel1.Align to alTop. Drop 4 Button components on Panel1 in a row. Put these names in the Buttons Captions:  OpenSave Clear Exit In that order. Next drop a StatusBar component on the Form, this should be aligned to alBottom. Then drop a TMemo on the Form, and set its Align Property in the Object Inspector to alClient. Next drop a OpenDialog component on the Form and a SaveDialog component. Double-Click on the first Button, this is the Button with Open as its caption. Then enter this code (the code between Begin & End;): procedure TForm1.Button1Click2(Sender: TObject); begin if OpenDialog1.Execute then Memo1.Lines.LoadFromFile(OpenDialog1.FileName); end;Double-Click on the second Button (The Save button) and enter this code: procedure TForm1.Button2Click2(Sender: TObject); begin if SaveDialog1.Execute then begin Memo1.Lines.SaveToFile(SaveDialog1.FileName); end; end;Double-Click on the third Button and enter this code: procedure TForm1.Button3Click2(Sender: TObject); begin Memo1.Clear; end;Double-Click on the forth button and add this code: procedure TForm1.Button4Click2(Sender: TObject); begin Close; end;Click on the OpenDialog1 component and in the Object Inspector double-click on Filter, then put in this text: TXT*.txt All files *.*Do the same for the SaveDialog component. Here comes the nifty part. Go up to Edit in the Delphi menu and then click on Select All then... Click on Component in the Delphi file menu, then click on Create Component Template... Type in the name you wish to use for the component template. You can leave the Palette page name as Template. And pick an icon for the new Template. Click on OK and that's it. Start a new project, go to the Template palette and click on your new component template. Drop this on the Form and run the program. And there you have it, an instant text editor. You can set the StatusBar anyway you want.Just another amazing thing you can do with Borland's Delphi!


Other 31 submission(s) by this author

 

 
Report Bad Submission
Use this form to notify us if this entry should be deleted (i.e contains no code, is a virus, etc.).
Reason:
 
Your Vote!

What do you think of this article(in the Beginner category)?
(The article with your highest vote will win this month's coding contest!)
Excellent  Good  Average  Below Average  Poor See Voting Log
 
Other User Comments
7/21/2000 11:48:07 PM:Yvan Dumont
Great man, i didn't know this!
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
9/15/2000 4:58:16 PM:fdman
sweet ...
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
Add Your Feedback!
Note:Not only will your feedback be posted, but an email will be sent to the code's author in your name.

NOTICE: The author of this article has been kind enough to share it with you.  If you have a criticism, please state it politely or it will be deleted.

For feedback not related to this particular article, please click here.
 
Name:
Comment:

 

Categories | Articles and Tutorials | Advanced Search | Recommended Reading | Upload | Newest Code | Code of the Month | Code of the Day | All Time Hall of Fame | Coding Contest | Search for a job | Post a Job | Ask a Pro Discussion Forum | Live Chat | Feedback | Customize | Delphi Home | Site Home | Other Sites | About the Site | Feedback | Link to the Site | Awards | Advertising | Privacy

Copyright© 1997 by Exhedra Solutions, Inc. All Rights Reserved.  By using this site you agree to its Terms and Conditions.  Planet Source Code (tm) and the phrase "Dream It. Code It" (tm) are trademarks of Exhedra Solutions, Inc.