[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 184
  • Last Modified:

How to write a shape panel

How to write a shape panel like Office Assistant done?
Any component could be use?

Thanks

Shekou
0
shekou
Asked:
shekou
1 Solution
 
Slick812Commented:
hello shekou, you can set the amount of a control or form that you can see with a "Region". A region tells windows OS what part is allowed to be used (visible and gets mouse clicks). you can set the region in the Forms OnCreate event. This will make Panel1 Elipitcal - - - -


private
    { Private declarations }
    Rgn1 : HRGN;


procedure TForm1.FormCreate(Sender: TObject);
begin
Rgn1 := CreateEllipticRgn(Panel1.BoundsRect.Left-Panel1.Left, Panel1.BoundsRect.Top-Panel1.Top, Panel1.BoundsRect.Right-Panel1.Left, Panel1.BoundsRect.Bottom-Panel1.Top);
  SetWindowRgn(Panel1.Handle, Rgn1, TRUE);
end;


// be sure to Release the Region
procedure FormDestroy(Sender: TObject);
begin
DeleteObject(Rgn1);
end;


you can create Regions of many different shapes
0
 
shekouAuthor Commented:
tried, but not work.

Thanks

Chiwan
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now