怎么做有圆角的窗体?(100分)

戏浪儿

Unregistered / Unconfirmed
GUEST, unregistred user!
怎么做有圆角的窗体?
 
Z

_zeus

Unregistered / Unconfirmed
GUEST, unregistred user!
CreateXXXRgn()
SetWindowRgn()
查一下 API。
 
B

bjaman

Unregistered / Unconfirmed
GUEST, unregistred user!
以下是将窗口定义为园角矩形的例子:
procedure TPortForm.FormCreate(Sender: TObject);
var
hr :thandle;
begin
hr:=createroundrectrgn(0,0,width,height,20,20);
//定义园角矩形(win API函数)
setwindowrgn(handle,hr,true);
//设置园角窗口
end;
为了使该窗口更好,应在onResize事件处理程序放相同的代码。
 
H

hlfdsj

Unregistered / Unconfirmed
GUEST, unregistred user!
procedure TForm1.FormCreate(Sender: TObject);
var
region: HRgn;
begin
region:=CreateEllipticRgn(1,1,200,200);
//边界矩形为正方形的椭圆就是圆
SetWindowRgn(handle,region, true);
//将窗体区域设为新创建的圆,bRedraw为true表示需要系统重绘窗口,此处也可为//false
end;
 
O

oldsheep35

Unregistered / Unconfirmed
GUEST, unregistred user!
还有就是用控件1stclass!
 
Z

_zeus

Unregistered / Unconfirmed
GUEST, unregistred user!
那未免太费劲了吧?
 
A

archonwang

Unregistered / Unconfirmed
GUEST, unregistred user!
能给我家分吗
我提供源码给你,给我你的邮箱
我的是archonwang1981@msn.com
 
Z

_zeus

Unregistered / Unconfirmed
GUEST, unregistred user!
我也要分啊,我先说的~~~~~~
 

Similar threads

D
Replies
0
Views
294
DelphiTeacher的专栏
D
D
Replies
0
Views
251
DelphiTeacher的专栏
D
D
Replies
0
Views
132
DelphiTeacher的专栏
D
Top Bottom