如何使现有的程序自适应不同的分辩率? 如题 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 窗体在不同分辨率下的大小和控件位置、变形问题:在800*600下做了一个FORM,但到640*480下一看却变了形,控件的相对位置都变了,不知道如何解决,请教诸位高手。Another_eYes (1998-11-22 22:39:29)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; 求 delphi 不使用IShellWindows 获取到外部IE的IHTMLDocument2 指针的方法 日期结算问题 〓★★★〓本人对编辑器要求极高,所以写了这个CodeFast〓★★★〓 怎样在DBGrid的某个单元格中加一个小按钮? 我想在程序中加一个显示查询结果的图表,DBChart1行吗?怎么用呢? 问一个简单问题: 请教:调试中如何查看某些变量的值. 请问在delphi中动态生成的控件怎样处理消息? !!!!!!!!关于TForm继承问题!!!!!!!!!!! 我用installshield express打包BDE,可是怎么也不成功! intraweb如何在一个TIWAppForm中显示另一个TIWAppForm(或TFrame) 请教如何把DBgrid里的查询数据直接打出来?
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货