一个小问题

wenjiu5 2003-01-10 05:19:12
为什么在2000下做的窗体在98下不同。如何解决
...全文
26 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
rikky 2003-01-10
  • 打赏
  • 举报
回复
form的Scaled设为false
fyje 2003-01-10
  • 打赏
  • 举报
回复
form的Scaled设为false
Billy_Chen28 2003-01-10
  • 打赏
  • 举报
回复
1、把字体的字符集设为CHINESE_GB2312
2、form的Scaled设为false
3、假设你在800*600的分辨率下设计的form,第一步:
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;
lengtouxiaoer 2003-01-10
  • 打赏
  • 举报
回复
运气不错。
你可以将Form.Scaled=False;

5,388

社区成员

发帖
与我相关
我的任务
社区描述
Delphi 开发及应用
社区管理员
  • VCL组件开发及应用社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧