X
xiongw
Unregistered / Unconfirmed
GUEST, unregistred user!
下面是两个方案,大家可以直接在本机测试,我调label的height与weith都没用,都有一部分不会显示出来,大家看看怎么解决,应该只是一点就通的,
一、
procedure TForm1.FormCreate(Sender: TObject);
var tf : TFont;
lf : LOGFONT;
begin
with label2 do begin
Font.Name := 'Arial';
Font.Size := 12;
tf := TFont.Create;
try
tf.Assign(label2.Font);
GetObject(tf.Handle,SizeOf(LOGFONT),@lf);
lf.lfEscapement := 100;
lf.lfOrientation := 100;
tf.Handle := CreateFontIndirect(lf);
width:=100;
height:=200;
Font.Assign(tf);
finally
tf.Free;
end;
end;
end;
二、
h:=CreateFont(100,20,180,180,0,0,0,1,1,1,0,0,0,'華康彩帶體');
if(h=0)then
RaiseLastWin32Error();
label1.Font.Handle:=h;
//createfont參數說明如下:
http://www.leftworld.net/online/apivb/CreateFont.htm
一、
procedure TForm1.FormCreate(Sender: TObject);
var tf : TFont;
lf : LOGFONT;
begin
with label2 do begin
Font.Name := 'Arial';
Font.Size := 12;
tf := TFont.Create;
try
tf.Assign(label2.Font);
GetObject(tf.Handle,SizeOf(LOGFONT),@lf);
lf.lfEscapement := 100;
lf.lfOrientation := 100;
tf.Handle := CreateFontIndirect(lf);
width:=100;
height:=200;
Font.Assign(tf);
finally
tf.Free;
end;
end;
end;
二、
h:=CreateFont(100,20,180,180,0,0,0,1,1,1,0,0,0,'華康彩帶體');
if(h=0)then
RaiseLastWin32Error();
label1.Font.Handle:=h;
//createfont參數說明如下:
http://www.leftworld.net/online/apivb/CreateFont.htm