I.T. Discussion Community!
-Collapse +Expand
Delphi
Search Delphi Group:

Advanced
-Collapse +Expand Delphi To/From
To/FromCODEGuides
-Collapse +Expand Delphi Store
PRESTWOODSTORE

Prestwood eMagazine

July Edition
Subscribe now! It's Free!
Enter your email:

   ► KBProgrammingDelphi for W...Using Data   Print This     
Part of the mo. lesson in the Oct 08 Issue of Prestwood eMag
Delphi Code Snippet:
 A flashcard from our Delphi Flashcards Library
 A code snippet from our Delphi Code Snippets Page
Create Round Windows

Use SetWindowRgn API call to make a round form. The SetWindowRgn function sets the window region of a window. The window region determines the area within the window where the operating system permits drawing. The operating system does not display any portion of a window that lies outside of the window region.

Simply use this function in the FormCreate event:


procedure TForm.FormCreate(Sender: TObject);
var
R1: HRGN;
R2: HRGN;

begin
R1 := CreateEllipticRgn(1, -1, Width - 1, Height);
R2 := CreateEllipticRgn(50, 50, Width - 50, Height - 50);
  CombineRgn(R2, R1, R2, RGN_XOR);
SetWindowRgn(Handle, R2, True);
end;

Comments

0 Comments.
Share a thought or comment...
 
Write a Comment...
...
Sign in...

If you are a member, Sign In. Or, you can Create a Free account now.


Anonymous Post (text-only, no HTML):

Enter your name and security key.

Your Name:
Security key = P1163A1
Enter key:
Code Contributed By Larry J. Rutledge :
I worked for Prestwood Software as a Delphi developer from 1997 through 2002. During that time I enjoyed working with Mike Prestwood and the other developers at Prestwood.
Visit Profile

 KB Article #100927 Counter
9418
Since 4/2/2008
Follow PrestwoodBoards on: 


©1995-2019 PrestwoodBoards  [Security & Privacy]
Professional IT Services: Coding | Websites | Computer Tech