怎样使窗体适合任何大小的变换,界面也随之变化,不影响界面的设计???(50分)

百事

Unregistered / Unconfirmed
GUEST, unregistred user!
1,怎样在1024*768和800*600之间都可以使用,界面不会变化?
2,怎样实现窗体的最大化,最小化,我的界面运行的时候只有关闭,我想把前面两项都
加上?
谢谢大家!!!
 
以前DFW上提供的方法可以,但实现的效果都不理想
看了Winamp的界面后受点启发,还是用OpenGL做好点(想的)。
 
Const
OrignHeight = 600;
OrignWidth = 800;
begin

//800*600與1024*768 解析度自適應
If (Screen.Width <> OrignWidth) then
begin
Height := LongInt(Height)*LongInt(Screen.Height) Div OrignHeight ;
Width := LongInt(Width)*LongInt(Screen.Width) Div OrignWidth ;
Scaleby(Screen.Width , OrignWidth);
end;
If Screen.Width = 800 then
begin
If Height > 475 then
Height := 475 ;
If Width > 790 then
Width := 790 ;
end;
If Screen.Width = 1024 then
begin
If Height > 630 then
Height := 630 ;
If Width > 1010 then
Width := 1010;
end;

end;
 
TO hcm0790:
实在对不起,我不知道CONST该在那里用,我放在外面运行不走,还有就是Scaleby应该怎么
定义?我这样放的,但是不能运行,我知道肯定是错的!!请指教!!!
var Height,Width,Scaleby:longint;
Const
OrignHeight = 600;
OrignWidth = 800;
begin

//800*600與1024*768 解析度自適應
If (Screen.Width <> OrignWidth) then
begin
Height := LongInt(Height)*LongInt(Screen.Height) Div OrignHeight ;
Width := LongInt(Width)*LongInt(Screen.Width) Div OrignWidth ;
Scaleby(Screen.Width , OrignWidth);
end;
If Screen.Width = 800 then
begin
If Height > 475 then
Height := 475 ;
If Width > 790 then
Width := 790 ;
end;
If Screen.Width = 1024 then
begin
If Height > 630 then
Height := 630 ;
If Width > 1010 then
Width := 1010;
end;

end;

procedure TForm2.FormCreate(Sender: TObject);
begin

form2.Align:=alclient;
mmspeedbutton1.Glyph.LoadFromFile('./S1.BMP');
end;
 
多人接受答案了。
 

Similar threads

S
回复
0
查看
3K
SUNSTONE的Delphi笔记
S
S
回复
0
查看
2K
SUNSTONE的Delphi笔记
S
顶部