?
解决方案 »
- 怎么判断字符串中的字符是占用一个字节还是两个字节呢?
- 运行delphi2007 精简版,提示Failed to load IDE add in ‘Borland.Studio.Together.dll’
- 一个巨简单的问题
- 有关于FTP的问题?
- 急救:客户端远端访问方法!
- 请问哪儿可以买到<<Delphi 5.X ADO MTS COM+高级程序设计篇>>这本书?
- 登陆界面遇到的问题?
- coudn't perform the edit becouse another user changed the record
- 如何给数组赋初值,若若的问
- 请问:windows下的查找窗体中的浏览按钮时,出现的窗体是如何作的。
- 我加赏100分
- 错误处理!!
inplementation
const
ScreenWidth: LongInt = 800; {I designed my form in 800x600 mode.}
ScreenHeight: LongInt = 600;{$R *.DFM}procedure TForm1.FormCreate(Sender: TObject);
begin
scaled := true;
if (screen.width <> ScreenWidth) then
begin
height := longint(height) * longint(screen.height) div ScreenHeight;
width := longint(width) * longint(screen.width) div ScreenWidth;
scaleBy(screen.width, ScreenWidth);
end;
end;下一步,要每個子控制的字体改到合适的大小:
type
TFooClass = class(TControl); { needed to get at protected }
{ font property }var
i: integer;
begin
for i := ControlCount - 1 downto 0 do
TFooClass(Controls[i]).Font.Size :=
(NewFormWidth div OldFormWidth) *
TFooClass(Controls[i]).Font.Size;
end;
比如form中放一个dbgrid,form最大化的时候,怎么让dbgrid也随着变大?