Delphi components

Every Windows® program has an about box these days and it is a nice effect to place a link in this aboutbox to your website or your e-mail.That's why i've written the TLinkLabel Delphi component when you place it on a form al properties are automaticly selected for example your cursor will change in the typical crHandPoint so how do you create a new component ? simple do this close any active project that you've running in the Delphi ide then choose file new you should see this screen.
screenshot
click ok the new component window will appear end will ask you to input some values
  1. Anchestertype = TLabel(in this specific case)
  2. Classname = TLinkLabel
  3. pallette page =where do you want you component to appear ?
  4. Unit file name= LinkLabel.pas
  5. Search path = Delphi generates this automaticly
when you click ok Delphi will generate a pascal source code file you gotta write the source code now of how you would like your component to behave you do this by using several keywords like default,property constructor here you'll see a small sample of the source of a component
type
TLinkLabel = class(TLabel)
public
constructor Create (AOwner:TComponent);override
publisched
property Cursor default crHandPoint;
propertyCaption;
property Color;
end;
procedure Register;
begin
RegisterComponents('Standard', [TLinkLabel]);
end;
Constructor TLinkLabel.Create(AOwner:TComponent);
begin
inherited;
Font.color:=clBlue;
Font.Style :=[wsUnderline,wsBold];
Color :=clInactiveBorder;
Cursor := crHandPoint;
Caption :='http://users.skynet.be/sky50637';
end;
When you're done with writing the source code choose component install component in most cases you see this screen to install a component you need a package i've used an existing package.
screenshot
click the compile button on the toolbar end follow the progress of the compiler if you get no errors Delphi will install the new component in the page you've choosen like this for example the big A is my new TLinkLabel component Delphi just uses the bitmap of the normal TLabel component because i didn't provide a bitmap for my component.With the TMailLabel component you can send e-mail it's for use in a TAboutBox
screenshot
to demonstrate the new component i've written a small example program wich you can see in the screenshot below.In the new version of my component you get this effect automaticly when you place the TMailLabel component on a form also you'll get a bold and underlined fontstyle.when you click the hyperlink you'll get this window (if outlook express is your default e-mail client)
screenshot
Our new TMailLabel component that's it you can use the component now off cource you gotta write code to run the users of your Delphi application default e-mail client for example like this ShellExecute(Handle,'open',PChar('mailto:yourusername@yourdomain.com'),'','',SW_SHOW);
Don't forget to add ShellApi to the uses clausule of the unit otherwise you'll get compile errors

Component Licence Author Download source code
TLink Freeware Loos Erik Linksource.zip
TNewStatusBar Freeware Loos Erik statusbar.zip
TMailLabel Freeware Loos Erik maillabel.zip

HolyNet Free Counte r

navigation links

index main page of this website
info info on file extensions produced by the Delphi ide
ide information about the Delphi ide
links links to other Delphi related websites
tips Delphi ide keyboard shortcuts etc
sourcecode Delphi sourcecode
about little info about me
books a list of Delphi books
board Delphi programming discussion board
newsgroups a list of Delphi programming discussion newsgroups
webring wanna join the DelphiVillage webring?
guestbook let me know you where here in my gustbook
help how to create windows® help files ?
delphi™ topsites i joined many toplists here is mine
setup how to build a setup program?


Delphi™ is a ® trademark from borland software company inc all rights reserved.
Windows™ is a ® trademark from Microsoft corporation
DelphiVillage copyright © 2001 Loos Erik all rights reserved
TLinkLabel copyright © 2001 Loos Erik all rights reserved