SET DIALOGBOX POSITION
Sets the Position of the Dialog Boxes in the Screen

(FindTextDialog, GetColor, GetFile, GetFolder, GetFont, MessageBoxTimeout, MsgXXX, PutFile, ReplaceTextDialog, SELECT PRINTER, etc.)

 

 

 

 

Syntax:

 

        SET DIALOGBOX [ POSITION ] ROW <nRow>|<@VarCodeBlockRow>|<NIL> COL <nCol>|<@VarCodeBlockCol>|<NIL>

 

        SET DIALOGBOX [ POSITION ] CENTER OF PARENT

 

        SET DIALOGBOX [ POSITION ] CENTER OF <hWnd>

 

        SET DIALOGBOX [ POSITION ] CENTER OF DESKTOP

 

        SET DIALOGBOX [ POSITION ] DISABLE

 

 

 

Example:

 

 

   #include "hmg.ch"

 

   FUNCTION Main()

 

      DEFINE WINDOW Form_1 ;

         AT 0,0 ;

         WIDTH  300 ;

         HEIGHT 200 ;

         MAIN;

         TITLE "Move This Window"

 

         @ 50,100 BUTTON Button_1 CAPTION "Click Here" ACTION MsgInfo ("Hello")

 

         // These CodeBlock puts the dialog box always in the same Row and Col of Form_1

         cbRow1 := {|| Form_1.Row }

         cbCol1 := {|| Form_1.Col }

 

         // These CodeBlock puts the dialog box always in the same Row and Col of Button_1

         cbRow2 := {|| ClientToScreenRow ( Form_1.HANDLE , Form_1.Button_1.Row ) }

         cbCol2 := {|| ClientToScreenCol ( Form_1.HANDLE , Form_1.Button_1.Col ) }

 

         SET DIALOGBOX ROW @cbRow1 COL @cbCol1

 

      END WINDOW

 

      CENTER WINDOW Form_1

 

      ACTIVATE WINDOW Form_1

 

   RETURN NIL