Kofa,
I've been trying to get this to work for monitors of different resolutions and I have failed.
It seems there is a Windows magnification factor that MVD can't cope with. It might be due to the version of Delphi that is used to make MVD.
Here is what I've tried, but it fails if the monitor is set to 150%.
procedure ScaleForm (F: TForm; ScreenWidth, ScreenHeight: LongInt) ;
begin
F.Scaled := True;
F.AutoScroll := False;
F.Position := poDefaultPosOnly; //poScreenCenter;
F.Font.Name := 'Arial';
if (Screen.Width <> ScreenWidth) then
begin
F.Height := (F.Height * Screen.Height) div ScreenHeight;
F.Width := (F.Width * Screen.Width) div ScreenWidth;
F.ScaleBy(Screen.Width,ScreenWidth) ;
end;
end;
procedure CentreForm(Form: TForm);
begin
with Form do
begin
Left := Application.frmMain.Left + (Application.frmMain.Width - Width) div 2;
if Left < 0 then Left:=0;
Top := Application.frmMain.Top + (Application.frmMain.Height - Height) div 2;
if Top <0 then Top:=0;
end;
end;
Called in the default begin...end by:
ScaleForm(frmMain,1920,1080) ;
//OR
CentreForm(frmMain);
On a clear disk you can seek forever