1 (edited by derek 2019-02-23 16:40:26)

Topic: Form Position

Hello Dmitry,
I use 'formsplash' to display logos, messages etc at the start of an application, using a small script. 
It should open, centred on Form1 for a set number of seconds and then close (I have had this working correctly on other applications).
However, even though the 'position' property of the 'formsplash' form object is set to 'pomainformcentre', the actual position, when the application runs, is incorrect - it is always top and left of the entire screen.  Changing the property to 'podesigned' and manually specifying the coordinates relative to Form1 has no effect.
Can you have a look at see what is wrong? (please find attached an example;  I am using WindowsXP and MVD 5.1 beta).
Also, is it possible to do the same thing with a panel instead of a form - for example, something like
  panel.visible := true;
  application.processmessages;
  sleep(5000);
  panel.visible := false;
Thanks,
Derek.

Post's attachments

Attachment icon splashscreen.zip 335.52 kb, 336 downloads since 2019-02-23 

Re: Form Position

Hello Derek

I'v tried your project, but modifying one property.

In fact, the label "some random message" is contained in a form (formsplash).
I modified the Position parameter of this form (container) to poScreenCenter and then
your splash forme stands in the center of the screen as you wish.

Can it help you ?

Regards
JB

3 (edited by derek 2019-02-23 21:25:27)

Re: Form Position

Hi Jean,
You are quite right - I have checked in my other projects where I use a 'splash' form and the object property is 'poscreencenter'. 
Why I changed it to 'pomainformcenter' - I have no idea!  Maybe I'm getting too old for all this - LOL!
Still, it is a bit strange that it doesn't work with 'pomainformcenter' - I would have thought it would do the same thing.
Thanks, as always, for your help.
Derek.

Re: Form Position

Hello Derek

This is what Embarcadero RAD says (which was used to create MVD)

The form remains the size you left it at design time, but is positioned in the center of the application's main form. This position should only be used with secondary forms. If set for a main form, it acts like poScreenCenter.

I think the last sentence answers your question

regards

JB

Re: Form Position

Aha!  It makes more sense now.
Thanks JB.