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

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

   ► MB LobbyPascal and Delphi Coding BoardDelphi News / Other Topic   Print This     

Tip: Create Round Windows

Tip: Create Round Windows in Delphi News / Other topic (part of our Pascal and Delphi Coding group).

Quick Search: Windows   Tip Create   Tip Create Round  
Larry J. Rutledge
Prestwood IT
Citrus Heights, CA USA
Version Info: Works with Delphi 2 and higher

Category: Multimedia

Description:
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;



------------------
Larry J. Rutledge

Programmer / Analyst
Prestwood Software & Consulting
7525 Auburn Blvd., #8
Citrus Heights, CA 95610


Old UBB Archived Link: [URL=http://www.prestwood.com]www.prestwood.com[/URL]



[This message has been edited by Larry Rutledge (edited November 30, 2000).]
Larry J. Rutledge

Analyst

Prestwood Software

www.prestwood.com
 Posted 19 years ago (Thread Starter)
Comment Quote
About Larry J. Rutledge -Collapse +Expand
Visit Profile
Approved member.
Member subscribes to this thread with a verified email.
About 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.

Post ID #168, 1 replies
Thread Started 11/27/2000 10:08:00 AM
View Counter=3232
Last Reply Posted 4/24/2008 5:22:15 PM)
Location=Citrus Heights, CA USA 
Joined=19 years ago   MB Posts=73   KB Posts=9  
Most Recent Post
ParaDelphi
-- USA

Thanks Larry.

----
Paul "The Coder" Santoro

 Posted 11 years ago
Comment Quote
About ParaDelphi -Collapse +Expand
Visit Profile
Approved member.
Member subscribes to this thread with a verified email.
About ParaDelphi

Paul has been developing in paradox and delphi since the mid 90s.


Post ID #12705 (Level 1.1)  Reply to 168
Thread Started 4/24/2008 5:22:15 PM
Location=-- USA 
Joined=12 years ago   MB Posts=23   KB Comments=2  

Revive Thread!

Add a comment to revive this old thread and make this archived thread more useful.

Write a Comment...
Full Editor
...
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 = P1181A1
Enter key:
Icon: A Post    Thread    Idea    Important!    Cool    Sad    No    Yes    Includes a Link...   
Thread #168 Counter
3232
Since 4/2/2008
Follow PrestwoodBoards on: 


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