Forum > LCL

Splash form "in pieces"

(1/4) > >>

dietmar:
Hi!

I designed a splash form with an image on it and a progress bar. Tested that on 2 different Notebooks. On the first one (where I designed it), I set Position to "poScreenCenter" and it just looks fine (resolution: 1600x900).

On the second one (resolution: 1920x1080) I get 2 problems:
1. The Splash form is not in the center, but out of it.
2. The progress bar isn't on the form any more, but somewhere in the middle of the desktop!?!

Does anyone have an explanation or even a solution for this behaviour?

Thx,
--Dietmar

MarkMLl:
No, but a good place to start would probably be in the Screen and ScreenInfo objects which allow you to get at the screen/monitor dimensions (with the caveat that I've not looked at this on Windows, only Linux/Solaris).

MarkMLl

winni:
Hi!

Not an explanation but a solution to center the SplashForm in the center:


--- Code: Pascal  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---procedure TSplashForm1.FormCreate(Sender: TObject);begin  left := (Screen.Width - self.Width) div 2;  Top :=  (Screen.Height - self.height) div 2;end;  

And the progressbar:
Make shure, that the parent of the progressbar is the SplashForm:

Right click on the progressbar  --> Change Parent


Winni

dietmar:
Thx, the centering now works...

But unfortunately, the progress bar already has the form as parent.
One crazy solution could be to calculate the position of the progress bar relatively to the form position...

--Dietmar

dietmar:
No, doesn't work this way. If I change the Left and Top values of the progress bar, it is completely hidden and no longer visible on the screen :/

--Dietmar

Navigation

[0] Message Index

[#] Next page

Go to full version