关于程序到了不同分辨率下的显示问题! 我的程序在800*600分辨率下设计的,但是如果程序到了1024*768或是其它分辨率下,会出现某些控件显示不正常!如:Group,Panel之类的界面控件。是不是都要在控件的OnResize事件中去控制?还有没有更好的办法? 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 implementationconstScreenWidth: LongInt = 800; {I designed my form in 800x600 mode.}ScreenHeight: LongInt = 600;{$R *.DFM}procedure TForm1.FormCreate(Sender: TObject);beginscaled := true;if (screen.width <> ScreenWidth) thenbeginheight := longint(height) * longint(screen.height) DIV ScreenHeight;width := longint(width) * longint(screen.width) DIV ScreenWidth;scaleBy(screen.width, ScreenWidth);end;end;下面是解决字体大小的代码:USES typinfo; {Add this to your USES statement.}vari: integer;beginfor i := componentCount - 1 downto 0 dowith components[i] dobeginif GetPropInfo(ClassInfo, 'font') <> nil thenfont.size := (NewFormWidth DIV OldFormWidth) * font.size;end;end;下面的函数可以解决问题:Form:需要调整的Form,OrgWidth:开发时屏幕的宽度,OrgHeight:开发时屏幕的高度。注意:需要把Form的Scaled设置为True。procedure AdjustForm(Form: TForm; const OrgWidth, OrgHeight: integer);beginwith Form dobeginWidth := Width * Screen.Width div OrgWidth;Height := Height * Screen.Height div OrgHeight;ScaleBy(Screen.Width, OrgWidth);end;end; procedure TForm1.Button1Click(Sender: TObject);beginAdjustForm(Self,1280,1024);end; 怎么把数据库取出的字符串转换成窗口的name值并show出来? 安装fastreport3控件后(EXE文件,自动安装的),DELHPI里面的其它控件都没有了,怎么回事---在线等 怎么在daetimepick中显示每个月的第一天 delphi可以只生成一个可执行文件吗? 如何解析二进制文件(无符号长整型)具体请参见!急!(xzwsun) 一个结果问题 语句table.locate('员工姓名','张三',[lopartialkey]);中的lopartialkey是什么意思 在Delphi6中如何在TImage上进行绘图而避免图片闪烁? 临时表更新问题? 限制TEdit的输入类型? 怎么使自己做的文本编辑器像 记事本 一样双击一个文本文件就打开它? Panasonic KX-P1121如何直接打印中文??
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货