Visit our Sponsor   Visit our Sponsor
delphi3000.com - the free delphi knowledge platform
delphi3000.com - the free delphi knowledge platform
Have a look at your member-status

connecting people's knowledge


  - Recent ArticlesRSS feed for Recent Articles on delphi3000.com
  - List of All Articles
  - Top Viewed Articles
  - Articles (+Attachem.)
  - Articles Of Interest
  - Categories
  - Top Uploader
  - Search
  - Index

  - My Home
  - Submit an Article
  - My Articles
  - My Personal Data
  - My Bookmarks
  - Activities
  - Login/Logout

  - Sign Up
  - Why Sign Up
  - Newsletter

  - Press
  - Advertise

  - Contact
  - Feedback





Community
Borland
ClubeDelphi
Dr. Bob
UK-BUG
Delphi Meetings
Planeta Delphi







Startblatt.de






Share this article with friendsShare this article with friends
Rate this articleRate this article - to keep the quality of delphi3000.com !
Comment this article or read through previous comments (2)


3D Labels (Lowered and Raised).Go to Abdulaziz Jasser's websiteFormat this article printer-friendly!Bookmark function is only available for registered users!
A simple way to do it.
Product:
Delphi all versions
Category:
GUI
Skill Level:
Scoring:
Last Update:
06/27/2002
Search Keys:
delphi delphi3000 article borland vcl code-snippet label Labels 3D font style GUI
Times Scored:
2
Visits:
3388
Uploader: Abdulaziz Jasser
Company: Saudi Telecommunications Compa
Reference: N/A
 
Question/Problem/Abstract:
How to create 3D labels?
Answer:



This procedure is very simple and useful.  You still can customize it to accept more parameters.  I hope you will enjoy it.


procedure Create3DLabel(oForm : TWinControl; const sText : String = 'Delphi';  iTop : Integer = 0; iLeft : Integer = 0; iDepth  : Integer = 3; sFontName : String = 'Arail'; iFontSize : Integer = 10; const sLookingType : String = 'Raised');
var
          oLabel1 : TLabel;
          oLabel2 : TLabel;
begin
          oLabel1 := TLabel.Create(oForm);
          oLabel1.Parent      := oForm;
          oLabel1.Transparent := True;
          oLabel1.Font.Name   := sFontName;
          oLabel1.Font.Size   := iFontSize;
          oLabel1.Caption     := sText;
          oLabel1.Font.Color  := clWhite;

          oLabel2 := TLabel.Create(oForm);
          oLabel2.Parent      := oForm;
          oLabel2.Transparent := True;
          oLabel2.Font.Name   := sFontName;
          oLabel2.Font.Size   := iFontSize;
          oLabel2.Caption     := sText;
          oLabel2.Font.Color  := clBlack;

          if sLookingType = 'Lowered' then begin
             oLabel1.Top         := iTop  + iDepth;
             oLabel1.Left        := iLeft + iDepth;

             oLabel2.Top         := iTop;
             oLabel2.Left        := iLeft;
             oLabel2.BringToFront;
          end;

          if sLookingType = 'Raised' then begin
             oLabel1.Top         := iTop  - iDepth;
             oLabel1.Left        := iLeft - iDepth;
             oLabel1.BringToFront;

             oLabel2.Top         := iTop;
             oLabel2.Left        := iLeft;
          end;
end;


Examples of use:

(1)
.......................................................................
Create3DLabel(TWinControl(self),'Hello Word',10,10,2,'Times New Roman',72,'Lowered');
.......................................................................


(2)
.......................................................................
Create3DLabel(TWinControl(self),'Hello Word',100,100,3,'Times New Roman',72,'Raised');
.......................................................................





Please rate this article!
Skill level:
BeginnerExpert

Useful:
No!Very!

Overall rating:
PoorExcellent



Comments to this article
Write a new comment
Sources Sources Sources ...
    Giovanni Petrucci (Jul 14 2002 10:47PM)

Look at:

http://www.delphisources.4xt.de


Respond

RE: Sources Sources Sources ...
Abdulaziz Jasser (Sep 15 2002 6:25PM)

I have looked at it and have seen NO relation with this article. In fact I could not read it.
Respond














 
Sign up to consume product discounts for Bronze memberships !

read more


  Visit our Sponsor

 

  Community Ad of
A. B. Talal
 
   














 







     
  Copyright © 2000 - 2007 delphi3000.com - All rights reserved. Terms of use. || Privacy
delphi3000.com is a service by bluestep.com IT-Services GmbH (Vienna)