Saving designer window position and size
Hi,
I have code in my app to save the position and size of the designer window
when it is closed (during the designer's Close event). The values are
correctly saved to the registry.
They are also read upon the creation of the designer at app startup. They
are read in correctly when I debug it.
But when the designer form is launched, I can debug all the way through the
designer's Show event and the WindowTop, WIndowLeft, WindowHeight,
WindowWidth values are all correct (as saved).
Then the window appears and it is the right size, but it is centered on the
screen. I set Top and Left and the values during the Show event were fine.
What would override the current WindowTop and WindowLeft settings *after*
the designer's Show event to force the window to be centetered?
Thanks,
Vinnie Murdico
I have code in my app to save the position and size of the designer window
when it is closed (during the designer's Close event). The values are
correctly saved to the registry.
They are also read upon the creation of the designer at app startup. They
are read in correctly when I debug it.
But when the designer form is launched, I can debug all the way through the
designer's Show event and the WindowTop, WIndowLeft, WindowHeight,
WindowWidth values are all correct (as saved).
Then the window appears and it is the right size, but it is centered on the
screen. I set Top and Left and the values during the Show event were fine.
What would override the current WindowTop and WindowLeft settings *after*
the designer's Show event to force the window to be centetered?
Thanks,
Vinnie Murdico
This discussion has been closed.
Comments
Please send a small example to support@digital-metaphors.com and we will
work on a solution for you.
--
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
supplied demo app under the EndUser - Report Explorer directory:
1) I choose the report All Data and double-clicked it. The designer window
opens.
2) I resize the designer window by dragging its borders larger.
3) I move the desiger window so its upper-left corner is very close to the
upper-left corner of my screen.
4) I close the designer window.
5) I close the demo app.
6) I restart the demo app.
7) I choose the report All Data and double-clicked it. The designer window
opens.
Now the designer window is the same size as previously changed it to, but
the entire designer window is centered on my screen, instead of in the
upper-left corner where I last closed it. It seems to save the window size
but not its position. This is the exact behavior exhibited in my
application.
-- Vinnie Murdico
You need to set the TppDesigner.Position to poDefault so the designer window
will not return to the center every time you reload it. This is a published
property of the TppDesigner so you can access it in the Object Inspector.
Once you change this, you should get the behavior you need.
--
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
Got it!
Thanks,
Vinnie Murdico