X
xac
Unregistered / Unconfirmed
GUEST, unregistred user!
这是一个从TCustomPanel继承下来的一个控件的一部分.
是网上的一个控件,他遍历其上的所有控件,然后修改之。
请问如何修改,其上控件的字体的大小?
procedure TAutoPanel.Resize;
var
I:Integer;
begin
inherited;
if (csDesigning in ComponentState) then Exit;
try
if (AutoChildPosLeft = false) and (AutoChildWidth = false) and
(AutoChildPosTop = false) and (AutoChildHeight = false) then Exit;
for i := 0 to ControlCount - 1 do begin
if(AutoChildPosLeft = true) then
if (AutoChildWidth = true) then begin
Controls.Left := MulDiv (PCtrlsCoordArr.Left,Width,pWidth);
Controls.Width := MulDiv (PCtrlsCoordArr.Width,Width,pWidth);
end
else
Controls.Left := Round(
PCtrlsCoordArr.Left * Width / pWidth +
((PCtrlsCoordArr.Width) * Width / pWidth -
(PCtrlsCoordArr.Width))/2
);
if(AutoChildPosTop = true) then
if (AutoChildHeight = true) then begin
Controls.Top := MulDiv (PCtrlsCoordArr.Top,Height,pHeight);
[red] Controls.Height := MulDiv (PCtrlsCoordArr.Height,Height,pHeight); //有错误,像Tcombobox不能这样修改高度[/red] end
else
Controls.Top := Round(
PCtrlsCoordArr.Top * Height / pHeight +
((PCtrlsCoordArr.Height) * Height / pHeight - (PCtrlsCoordArr.Height))/2 );
end;
finally
end;
end;
是网上的一个控件,他遍历其上的所有控件,然后修改之。
请问如何修改,其上控件的字体的大小?
procedure TAutoPanel.Resize;
var
I:Integer;
begin
inherited;
if (csDesigning in ComponentState) then Exit;
try
if (AutoChildPosLeft = false) and (AutoChildWidth = false) and
(AutoChildPosTop = false) and (AutoChildHeight = false) then Exit;
for i := 0 to ControlCount - 1 do begin
if(AutoChildPosLeft = true) then
if (AutoChildWidth = true) then begin
Controls.Left := MulDiv (PCtrlsCoordArr.Left,Width,pWidth);
Controls.Width := MulDiv (PCtrlsCoordArr.Width,Width,pWidth);
end
else
Controls.Left := Round(
PCtrlsCoordArr.Left * Width / pWidth +
((PCtrlsCoordArr.Width) * Width / pWidth -
(PCtrlsCoordArr.Width))/2
);
if(AutoChildPosTop = true) then
if (AutoChildHeight = true) then begin
Controls.Top := MulDiv (PCtrlsCoordArr.Top,Height,pHeight);
[red] Controls.Height := MulDiv (PCtrlsCoordArr.Height,Height,pHeight); //有错误,像Tcombobox不能这样修改高度[/red] end
else
Controls.Top := Round(
PCtrlsCoordArr.Top * Height / pHeight +
((PCtrlsCoordArr.Height) * Height / pHeight - (PCtrlsCoordArr.Height))/2 );
end;
finally
end;
end;