Pascal for WIN 1.5 - Centering Window on Screen 
Author Message
 Pascal for WIN 1.5 - Centering Window on Screen

I need help in knowing the code to center my window applications on the screen.
 My current application after being executed will always go to the top left
hand side of the screen.

I know how to center text in the window but I need to know how to center the
application window.
thanks



Wed, 18 Jun 1902 08:00:00 GMT  
 Pascal for WIN 1.5 - Centering Window on Screen


Quote:
>I need help in knowing the code to center my window applications on the screen.
> My current application after being executed will always go to the top left
>hand side of the screen.

Hi, the window position is handled by Windows. If you want to give it
a different position you have to calc screen units and window with
first, and then set the new position in the Init-constructor:

constructor MyWin.Init(aParent : pWindowsObject);
begin
  inherited Init(aParent);
  { calc win and screen width }
  { calc top left position }
  attr.x:=leftPosition;
  attr.y:=TopPosition;
end;

Bye bye
- Ulli -
===
"On no account allow a Vogon to read poetry at you!"

Ulli Conrad

http://www.gwdg.de/~uconrad1
Public PGP-Key at http://www.gwdg.de/~uconrad1/upgpkey.asc



Wed, 18 Jun 1902 08:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. WIN 1.5 Pascal - Centering text window on screen

2. Centering Window with Win 1.5

3. Win 1.5 Pascal - Displaying Lines in/on Screens/Window

4. Win 1.5 Pascal - CRT Unit - Window positioning

5. Centering my WINDOW ON THE SCREEN

6. WIN 1.5 - ICON in Window

7. WIN 1.5, Icon question (place icon in title window

8. Adding an Icon to my Window Bar - Win 1.5

9. Win 1.5 Debugger Fix for Windows 95

10. Printing in Win 1.5 Pascal

11. Win 1.5 pascal - Executing a program

12. Turbo Pascal for Win 1.5 question

 

 
Powered by phpBB® Forum Software