Kbase 16086: How to Center a Window on the Screen in MS-Windows
Autor |
  Progress Software Corporation - Progress |
Acesso |
  Público |
Publicação |
  5/10/1998 |
|
How to Center a Window on the Screen in MS-Windows
INTRODUCTION:
=============
This Knowledgebase entry describes how to get a window to come up
centered on the screen.
WHY YOU NEED TO KNOW THIS:
===========================
You need to know this if you ever have the need to center a window
on the screen.
PROCEDURAL APPROACH:
====================
For a "normal" window you should insert the following code in the
"Main Block" section immediately before the "RUN enable_UI" statement.
For a "smart" window you should insert the following code in the
"local-initialize" procedure before the default behavior.
ASSIGN {&WINDOW-NAME}:X =
(SESSION:WIDTH-PIXELS - {&WINDOW-NAME}:WIDTH-PIXELS) / 2
{&WINDOW-NAME}:Y =
(SESSION:HEIGHT-PIXELS - {&WINDOW-NAME}:HEIGHT-PIXELS) / 2.
Progress Software Technical Support Note # 16086