 |
BorlandTalk.com Borland discussion newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
JD Guest
|
Posted: Wed Jul 30, 2003 8:04 am Post subject: Re: How to position a form on screen at runtime? |
|
|
"Rainer Könnecke" <r.koennecke (AT) ist-net (DOT) de> wrote:
| Quote: | [...] Just writing Left=24; Top=12; in the contructor does
not lead to the wished result
|
It should.
| Quote: | (same applies to OnCreate and OnShow)
|
Never ever ever use the OnCreate / OnDestroy events. They are
Delphi remnants that can execute before the Constructor / Destructor
which is illegal in C++.
| Quote: | I could manage to use OnActivate but then there is a flicker
since the form appears at its design-time position and then
it is moved to the new position!
|
This tells me that the assignment is working. You must be
overriding the assignments in the Constructor somewhere.
| Quote: | The form is derived from a base form which itself is based on TForm.
|
That should make no difference. It's somewhere in your code.
~ JD
|
|
| Back to top |
|
 |
Jonathan Arnold Guest
|
Posted: Wed Jul 30, 2003 12:19 pm Post subject: Re: How to position a form on screen at runtime? |
|
|
Rainer Könnecke wrote:
| Quote: | What do I have to obey to correctly position my form on the screen at at
certain location which is determined at runtime?
Just writing Left=24; Top=12; in the contructor does not lead to the wished
result (same applies to OnCreate and OnShow)
|
As mentioned - do not *ever* use OnCreate/OnDestroy. They are lingering
Delphi-isms that should be avoided at all costs. See:
http://www.bcbdev.com/articles/suggest.htm#oncreate
Otherwise, setting Top/Left in the constructor works fine, *if* you have
the Position property of the form set correctly. Most of the options work,
but some, like DesktopCenter, will override your changes and reposition
your form. Set it to poDesigned and you should be fine.
--
Jonathan Arnold C/C++/CBuilder Keen Advice:
http://www.keen.com/categories/categorylist_expand.asp?sid=5156620
Comprehensive C++Builder link site:
http://www.buddydog.org/C++Builder/c++builder.html
|
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|