locked
How to make screen to fit for several resolutions RRS feed

  • Question

  • A few years ago, I use .SPR files to draw the screen.

    I draw screen to fit for 1024x768 Resolution.

    But now the problem is that, my customer changes their OS with new version of Windows.

    In that OS my previous software screen do not fit.

    So is there any command available, that I can write in my program so the software screen befomes fit for all types of OS and all types of Resolutions (Whether For .SPR Files or Forms (.SCX files))

    Thanks

    Deepak


    Deepak Kharpate

    Tuesday, September 8, 2015 5:51 PM

Answers

  • Also, look at this program, might help you

    DEFINE CLASS stdresizer AS custom
      HEIGHT = 16
      WIDTH = 23
      NAME = "stdresizer"
      *-- Called from the resizer's init...saves the original dimension of all for objects...must be modified so it can be called explicitly when delayed instantiation is used
      PROCEDURE saveoriginaldimensions
      LPARAMETERS tocontrol
      LOCAL loPage, loControl, loColumn, lnCol
    
      *** If the object does not have an AddProperty method,
      *** we can't add the properties to save the original dimension.
      *** So bail out
      IF NOT PEMSTATUS( tocontrol, 'AddProperty', 5 )
        RETURN
      ENDIF
      WITH tocontrol
        *** Go ahead and add the properties to hold the object's original dimensions
        IF PEMSTATUS( tocontrol, 'Width', 5 )
          IF NOT PEMSTATUS( tocontrol, 'nOriginalWidth', 5 )
            .ADDPROPERTY( 'nOriginalWidth', .WIDTH )
          ENDIF
        ENDIF
        IF PEMSTATUS( tocontrol, 'Height', 5 )
          IF NOT PEMSTATUS( tocontrol, 'nOriginalHeight', 5 )
            .ADDPROPERTY( 'nOriginalHeight', .HEIGHT )
          ENDIF
        ENDIF
        IF PEMSTATUS( tocontrol, 'Top', 5 )
          IF NOT PEMSTATUS( tocontrol, 'nOriginalTop', 5 )
            .ADDPROPERTY( 'nOriginalTop', .TOP )
          ENDIF
        ENDIF
        IF PEMSTATUS( tocontrol, 'Left', 5 )
          IF NOT PEMSTATUS( tocontrol, 'nOriginalLeft', 5 )
            .ADDPROPERTY( 'nOriginalLeft', .LEFT )
          ENDIF
        ENDIF
        IF PEMSTATUS( tocontrol, 'Fontsize', 5 )
          IF NOT PEMSTATUS( tocontrol, 'nOriginalFontSize', 5 )
            .ADDPROPERTY( 'nOriginalFontSize', .FONTSIZE )
          ENDIF
        ENDIF
        *** Now see if we have to drill down. Also, take care of special
        *** case like grids where we have to save RowHeight, HeaderHeight, etc
        *** And combos where we need to save ColumnWidths
        DO CASE
        CASE UPPER( .BASECLASS ) = 'PAGEFRAME'
          FOR EACH loPage IN .PAGES
            THIS.saveoriginaldimensions( loPage )
          ENDFOR
    
        CASE INLIST( UPPER( .BASECLASS ), 'PAGE', 'CONTAINER' )
          FOR EACH loControl IN .CONTROLS
            THIS.saveoriginaldimensions( loControl )
          ENDFOR
    
        CASE UPPER( .BASECLASS ) = 'GRID'
          IF NOT PEMSTATUS( tocontrol, 'nOriginalRowHeight', 5 )
            .ADDPROPERTY( 'nOriginalRowHeight',    .ROWHEIGHT )
          ENDIF
          IF NOT PEMSTATUS( tocontrol, 'nOriginalHeaderHeight', 5 )
            .ADDPROPERTY( 'nOriginalHeaderHeight', .HEADERHEIGHT )
          ENDIF
          IF NOT PEMSTATUS( tocontrol, 'nOriginalColumnWidths[ 1 ]', 5 )
            .ADDPROPERTY( 'nOriginalColumnWidths[ 1 ]' )
          ENDIF
          DIMENSION .nOriginalColumnWidths[ .ColumnCount ]
          FOR lnCol = 1 TO .COLUMNCOUNT
            .nOriginalColumnWidths[lnCol] = .COLUMNS[ lnCol ].WIDTH
          ENDFOR
    
        CASE INLIST( UPPER( .BASECLASS ), 'COMBOBOX', 'LISTBOX' )
          IF NOT PEMSTATUS( tocontrol, 'nOriginalColumnWidths', 5 )
            .ADDPROPERTY( 'nOriginalColumnWidths', .COLUMNWIDTHS )
          ENDIF
    
        CASE INLIST( UPPER( .BASECLASS ), 'COMMANDGROUP', 'OPTIONGROUP' )
          LOCAL   lnButton
          FOR lnButton = 1 TO .BUTTONCOUNT
            THIS.saveoriginaldimensions( .BUTTONS[ lnButton ] )
          ENDFOR
    
        OTHERWISE
          *** There is no otherwise...I think we got all cases
    
        ENDCASE
      ENDWITH
      ENDPROC
    
    
      *-- Called from the adjustControls method, it resizes and repositions each control it is passed and drills down when necessary
      PROCEDURE resizecontrols
      LPARAMETERS tocontrol, tnWidthRatio, tnHeightRatio
      LOCAL ARRAY lnColumnWidths[ 1 ]
      LOCAL   loPage, loControl, loColumn, lnCol
    
      WITH tocontrol
        IF PEMSTATUS( tocontrol, 'Width', 5 )
          IF PEMSTATUS( tocontrol, 'nOriginalWidth', 5 )
            .WIDTH = .nOriginalWidth * tnWidthRatio
          ENDIF
        ENDIF
        IF PEMSTATUS( tocontrol, 'Height', 5 )
          IF PEMSTATUS( tocontrol, 'nOriginalHeight', 5 )
            .HEIGHT = .nOriginalHeight * tnHeightRatio
          ENDIF
        ENDIF
        IF PEMSTATUS( tocontrol, 'Top', 5 )
          IF PEMSTATUS( tocontrol, 'nOriginalTop', 5 )
            .TOP = .nOriginalTop * tnHeightRatio
          ENDIF
        ENDIF
        IF PEMSTATUS( tocontrol, 'Left', 5 )
          IF PEMSTATUS( tocontrol, 'nOriginalLeft', 5 )
            .LEFT = .nOriginalLeft * tnWidthRatio
          ENDIF
        ENDIF
        *** Now resize the font of the control
        *** But only if it is not a grid or an edit box. For these controls,
        *** we want to see more info, not a bigger font
        IF NOT INLIST( UPPER( .BASECLASS ), 'GRID', 'EDITBOX', 'LISTBOX' )
          IF PEMSTATUS( tocontrol, 'Fontsize', 5 )
            IF PEMSTATUS( tocontrol, 'nOriginalFontSize', 5 )
              .FONTSIZE = IIF( INT( .nOriginalFontSize * tnWidthRatio ) < 1, 1, ;
                INT( .nOriginalFontSize * tnWidthRatio )   )
            ENDIF
          ENDIF
        ENDIF
    
        DO CASE
        CASE UPPER( .BASECLASS ) = 'PAGEFRAME'
          FOR EACH loPage IN .PAGES
            THIS.resizecontrols( loPage, tnWidthRatio, tnHeightRatio )
          ENDFOR
    
        CASE INLIST( UPPER( .BASECLASS ), 'PAGE', 'CONTAINER' )
          FOR EACH loControl IN .CONTROLS
            THIS.resizecontrols( loControl, tnWidthRatio, tnHeightRatio )
          ENDFOR
    
        CASE UPPER( .BASECLASS ) = 'GRID'
          *** Only resize the columns if there is not horizontal scroll bar
          IF INLIST( .SCROLLBARS, 0, 2 )
            FOR lnCol = 1 TO .COLUMNCOUNT
              .COLUMNS[ lnCol ].WIDTH = .nOriginalColumnWidths[ lnCol ] * tnWidthRatio
            ENDFOR
          ENDIF
    
        CASE INLIST( UPPER( .BASECLASS ), 'COMBOBOX', 'LISTBOX' )
          LOCAL   lnCol, lnStart,   lnEnd, lnLen, lcColumnWidths
          IF .COLUMNCOUNT < 2
            .COLUMNWIDTHS = ALLTRIM( STR( .WIDTH ) )
          ELSE
            lcColumnWidths = ''
            lnStart        = 1
            FOR lnCol = 1 TO .COLUMNCOUNT - 1
              lnEnd = AT( ',', .nOriginalColumnWidths, lnCol )
              lnLen = lnEnd - lnStart
              lcColumnWidths = lcColumnWidths + ;
                IIF( EMPTY( lcColumnWidths ), '', ',' ) + ;
                ALLTRIM( STR( VAL( SUBSTR( .nOriginalColumnWidths, lnStart, lnLen ) ) * tnWidthRatio ) )
              lnStart = lnEnd + 1
            ENDFOR
            lnLen = LEN( .nOriginalColumnWidths ) - lnStart + 1
            lcColumnWidths = lcColumnWidths   + ',' + ;
              ALLTRIM( STR( VAL( SUBSTR( .nOriginalColumnWidths, lnStart, lnLen ) ) * tnWidthRatio ) )
            .COLUMNWIDTHS = lcColumnWidths
          ENDIF
    
        CASE INLIST( UPPER( .BASECLASS ), 'COMMANDGROUP', 'OPTIONGROUP' )
          LOCAL lnButton
          FOR lnButton = 1 TO .BUTTONCOUNT
            THIS.resizecontrols( .BUTTONS[ lnButton ], tnWidthRatio, tnHeightRatio )
          ENDFOR
    
        OTHERWISE
          *** There is no otherwise...I think we got all cases
    
        ENDCASE
      ENDWITH
      ENDPROC
    
    
      *-- Called from the form's Resize even, it loops through the form's controls collection and passes a reference to each object to the class's ResizeControls method so it can be resized and/or drilled down into
      PROCEDURE adjustcontrols
      LPARAMETER tocontrol
      LOCAL llLockScreen, loControl, loParent, lnWidthRatio, lnHeightRatio
    
      IF VARTYPE( tocontrol ) # 'O' AND NOT ISNULL( tocontrol )
        loParent = THIS.PARENT
      ELSE
        loParent = tocontrol
      ENDIF
    
      *** Bail out if the any of the required properties are not found in the
      *** parent container
      IF NOT PEMSTATUS( THISFORM, 'nOriginalWidth', 5 )
        RETURN
      ENDIF
      IF NOT PEMSTATUS( THISFORM, 'nOriginalHeight', 5 )
        RETURN
      ENDIF
    
      WITH THISFORM
        lnWidthRatio  = .WIDTH  / .nOriginalWidth
        lnHeightRatio = .HEIGHT / .nOriginalHeight
    
        *** Save current status of LockScreen
        llLockScreen = .LOCKSCREEN
        .LOCKSCREEN = .T.
    
        FOR EACH loControl IN loParent.CONTROLS
          THIS.resizecontrols( loControl, lnWidthRatio, lnHeightRatio )
        ENDFOR
    
        .LOCKSCREEN = llLockScreen
      ENDWITH
      ENDPROC
    
    
      PROCEDURE INIT
      LOCAL loContainer, loControl
    
      loContainer = THIS.PARENT
    
      WITH loContainer
        *** If the parent continer doesn't have the nOriginalHeight and nOriginalWidth properties
        *** then add them and save the form dimensions
        IF NOT PEMSTATUS( loContainer, 'nOriginalHeight', 5 )
          .ADDPROPERTY( 'nOriginalHeight', .HEIGHT )
        ENDIF
        IF NOT PEMSTATUS( loContainer, 'nOriginalWidth', 5 )
          .ADDPROPERTY( 'nOriginalWidth', .WIDTH )
        ENDIF
    
        *** Set a minimun Width and Height to avoid errors later if not
        *** already set
        IF .MINWIDTH = -1
          .MINWIDTH  = .WIDTH / 2
        ENDIF
        IF .MINHEIGHT = -1
          .MINHEIGHT = .HEIGHT / 2
        ENDIF
    
        *** Now save the relevant visual properties (height, width, columnwidths, etc)
        *** of all the controls on the parent container
        FOR EACH loControl IN .CONTROLS
          THIS.saveoriginaldimensions( loControl )
        ENDFOR
      ENDWITH
      ENDPROC
    
    
    ENDDEFINE
    
    
    
    
    Drop the resizer on the base form class in its Init() like so:
    
    
    *** Add the resizer
    This.NewObject( 'Resizer', 'stdResizer', 'stdCustom.vcx' )
    DODEFAULT()
    
    
    

    • Proposed as answer by Tom BorgmannEditor Thursday, September 10, 2015 8:05 AM
    • Marked as answer by Youjun Tang Wednesday, September 16, 2015 10:06 AM
    Wednesday, September 9, 2015 2:42 PM

All replies

  • Had you tried _screen.WindowState = 2 (Maximized) or replace _screen. for the form/screen name

    Tuesday, September 8, 2015 11:53 PM
  • Also, look at this program, might help you

    DEFINE CLASS stdresizer AS custom
      HEIGHT = 16
      WIDTH = 23
      NAME = "stdresizer"
      *-- Called from the resizer's init...saves the original dimension of all for objects...must be modified so it can be called explicitly when delayed instantiation is used
      PROCEDURE saveoriginaldimensions
      LPARAMETERS tocontrol
      LOCAL loPage, loControl, loColumn, lnCol
    
      *** If the object does not have an AddProperty method,
      *** we can't add the properties to save the original dimension.
      *** So bail out
      IF NOT PEMSTATUS( tocontrol, 'AddProperty', 5 )
        RETURN
      ENDIF
      WITH tocontrol
        *** Go ahead and add the properties to hold the object's original dimensions
        IF PEMSTATUS( tocontrol, 'Width', 5 )
          IF NOT PEMSTATUS( tocontrol, 'nOriginalWidth', 5 )
            .ADDPROPERTY( 'nOriginalWidth', .WIDTH )
          ENDIF
        ENDIF
        IF PEMSTATUS( tocontrol, 'Height', 5 )
          IF NOT PEMSTATUS( tocontrol, 'nOriginalHeight', 5 )
            .ADDPROPERTY( 'nOriginalHeight', .HEIGHT )
          ENDIF
        ENDIF
        IF PEMSTATUS( tocontrol, 'Top', 5 )
          IF NOT PEMSTATUS( tocontrol, 'nOriginalTop', 5 )
            .ADDPROPERTY( 'nOriginalTop', .TOP )
          ENDIF
        ENDIF
        IF PEMSTATUS( tocontrol, 'Left', 5 )
          IF NOT PEMSTATUS( tocontrol, 'nOriginalLeft', 5 )
            .ADDPROPERTY( 'nOriginalLeft', .LEFT )
          ENDIF
        ENDIF
        IF PEMSTATUS( tocontrol, 'Fontsize', 5 )
          IF NOT PEMSTATUS( tocontrol, 'nOriginalFontSize', 5 )
            .ADDPROPERTY( 'nOriginalFontSize', .FONTSIZE )
          ENDIF
        ENDIF
        *** Now see if we have to drill down. Also, take care of special
        *** case like grids where we have to save RowHeight, HeaderHeight, etc
        *** And combos where we need to save ColumnWidths
        DO CASE
        CASE UPPER( .BASECLASS ) = 'PAGEFRAME'
          FOR EACH loPage IN .PAGES
            THIS.saveoriginaldimensions( loPage )
          ENDFOR
    
        CASE INLIST( UPPER( .BASECLASS ), 'PAGE', 'CONTAINER' )
          FOR EACH loControl IN .CONTROLS
            THIS.saveoriginaldimensions( loControl )
          ENDFOR
    
        CASE UPPER( .BASECLASS ) = 'GRID'
          IF NOT PEMSTATUS( tocontrol, 'nOriginalRowHeight', 5 )
            .ADDPROPERTY( 'nOriginalRowHeight',    .ROWHEIGHT )
          ENDIF
          IF NOT PEMSTATUS( tocontrol, 'nOriginalHeaderHeight', 5 )
            .ADDPROPERTY( 'nOriginalHeaderHeight', .HEADERHEIGHT )
          ENDIF
          IF NOT PEMSTATUS( tocontrol, 'nOriginalColumnWidths[ 1 ]', 5 )
            .ADDPROPERTY( 'nOriginalColumnWidths[ 1 ]' )
          ENDIF
          DIMENSION .nOriginalColumnWidths[ .ColumnCount ]
          FOR lnCol = 1 TO .COLUMNCOUNT
            .nOriginalColumnWidths[lnCol] = .COLUMNS[ lnCol ].WIDTH
          ENDFOR
    
        CASE INLIST( UPPER( .BASECLASS ), 'COMBOBOX', 'LISTBOX' )
          IF NOT PEMSTATUS( tocontrol, 'nOriginalColumnWidths', 5 )
            .ADDPROPERTY( 'nOriginalColumnWidths', .COLUMNWIDTHS )
          ENDIF
    
        CASE INLIST( UPPER( .BASECLASS ), 'COMMANDGROUP', 'OPTIONGROUP' )
          LOCAL   lnButton
          FOR lnButton = 1 TO .BUTTONCOUNT
            THIS.saveoriginaldimensions( .BUTTONS[ lnButton ] )
          ENDFOR
    
        OTHERWISE
          *** There is no otherwise...I think we got all cases
    
        ENDCASE
      ENDWITH
      ENDPROC
    
    
      *-- Called from the adjustControls method, it resizes and repositions each control it is passed and drills down when necessary
      PROCEDURE resizecontrols
      LPARAMETERS tocontrol, tnWidthRatio, tnHeightRatio
      LOCAL ARRAY lnColumnWidths[ 1 ]
      LOCAL   loPage, loControl, loColumn, lnCol
    
      WITH tocontrol
        IF PEMSTATUS( tocontrol, 'Width', 5 )
          IF PEMSTATUS( tocontrol, 'nOriginalWidth', 5 )
            .WIDTH = .nOriginalWidth * tnWidthRatio
          ENDIF
        ENDIF
        IF PEMSTATUS( tocontrol, 'Height', 5 )
          IF PEMSTATUS( tocontrol, 'nOriginalHeight', 5 )
            .HEIGHT = .nOriginalHeight * tnHeightRatio
          ENDIF
        ENDIF
        IF PEMSTATUS( tocontrol, 'Top', 5 )
          IF PEMSTATUS( tocontrol, 'nOriginalTop', 5 )
            .TOP = .nOriginalTop * tnHeightRatio
          ENDIF
        ENDIF
        IF PEMSTATUS( tocontrol, 'Left', 5 )
          IF PEMSTATUS( tocontrol, 'nOriginalLeft', 5 )
            .LEFT = .nOriginalLeft * tnWidthRatio
          ENDIF
        ENDIF
        *** Now resize the font of the control
        *** But only if it is not a grid or an edit box. For these controls,
        *** we want to see more info, not a bigger font
        IF NOT INLIST( UPPER( .BASECLASS ), 'GRID', 'EDITBOX', 'LISTBOX' )
          IF PEMSTATUS( tocontrol, 'Fontsize', 5 )
            IF PEMSTATUS( tocontrol, 'nOriginalFontSize', 5 )
              .FONTSIZE = IIF( INT( .nOriginalFontSize * tnWidthRatio ) < 1, 1, ;
                INT( .nOriginalFontSize * tnWidthRatio )   )
            ENDIF
          ENDIF
        ENDIF
    
        DO CASE
        CASE UPPER( .BASECLASS ) = 'PAGEFRAME'
          FOR EACH loPage IN .PAGES
            THIS.resizecontrols( loPage, tnWidthRatio, tnHeightRatio )
          ENDFOR
    
        CASE INLIST( UPPER( .BASECLASS ), 'PAGE', 'CONTAINER' )
          FOR EACH loControl IN .CONTROLS
            THIS.resizecontrols( loControl, tnWidthRatio, tnHeightRatio )
          ENDFOR
    
        CASE UPPER( .BASECLASS ) = 'GRID'
          *** Only resize the columns if there is not horizontal scroll bar
          IF INLIST( .SCROLLBARS, 0, 2 )
            FOR lnCol = 1 TO .COLUMNCOUNT
              .COLUMNS[ lnCol ].WIDTH = .nOriginalColumnWidths[ lnCol ] * tnWidthRatio
            ENDFOR
          ENDIF
    
        CASE INLIST( UPPER( .BASECLASS ), 'COMBOBOX', 'LISTBOX' )
          LOCAL   lnCol, lnStart,   lnEnd, lnLen, lcColumnWidths
          IF .COLUMNCOUNT < 2
            .COLUMNWIDTHS = ALLTRIM( STR( .WIDTH ) )
          ELSE
            lcColumnWidths = ''
            lnStart        = 1
            FOR lnCol = 1 TO .COLUMNCOUNT - 1
              lnEnd = AT( ',', .nOriginalColumnWidths, lnCol )
              lnLen = lnEnd - lnStart
              lcColumnWidths = lcColumnWidths + ;
                IIF( EMPTY( lcColumnWidths ), '', ',' ) + ;
                ALLTRIM( STR( VAL( SUBSTR( .nOriginalColumnWidths, lnStart, lnLen ) ) * tnWidthRatio ) )
              lnStart = lnEnd + 1
            ENDFOR
            lnLen = LEN( .nOriginalColumnWidths ) - lnStart + 1
            lcColumnWidths = lcColumnWidths   + ',' + ;
              ALLTRIM( STR( VAL( SUBSTR( .nOriginalColumnWidths, lnStart, lnLen ) ) * tnWidthRatio ) )
            .COLUMNWIDTHS = lcColumnWidths
          ENDIF
    
        CASE INLIST( UPPER( .BASECLASS ), 'COMMANDGROUP', 'OPTIONGROUP' )
          LOCAL lnButton
          FOR lnButton = 1 TO .BUTTONCOUNT
            THIS.resizecontrols( .BUTTONS[ lnButton ], tnWidthRatio, tnHeightRatio )
          ENDFOR
    
        OTHERWISE
          *** There is no otherwise...I think we got all cases
    
        ENDCASE
      ENDWITH
      ENDPROC
    
    
      *-- Called from the form's Resize even, it loops through the form's controls collection and passes a reference to each object to the class's ResizeControls method so it can be resized and/or drilled down into
      PROCEDURE adjustcontrols
      LPARAMETER tocontrol
      LOCAL llLockScreen, loControl, loParent, lnWidthRatio, lnHeightRatio
    
      IF VARTYPE( tocontrol ) # 'O' AND NOT ISNULL( tocontrol )
        loParent = THIS.PARENT
      ELSE
        loParent = tocontrol
      ENDIF
    
      *** Bail out if the any of the required properties are not found in the
      *** parent container
      IF NOT PEMSTATUS( THISFORM, 'nOriginalWidth', 5 )
        RETURN
      ENDIF
      IF NOT PEMSTATUS( THISFORM, 'nOriginalHeight', 5 )
        RETURN
      ENDIF
    
      WITH THISFORM
        lnWidthRatio  = .WIDTH  / .nOriginalWidth
        lnHeightRatio = .HEIGHT / .nOriginalHeight
    
        *** Save current status of LockScreen
        llLockScreen = .LOCKSCREEN
        .LOCKSCREEN = .T.
    
        FOR EACH loControl IN loParent.CONTROLS
          THIS.resizecontrols( loControl, lnWidthRatio, lnHeightRatio )
        ENDFOR
    
        .LOCKSCREEN = llLockScreen
      ENDWITH
      ENDPROC
    
    
      PROCEDURE INIT
      LOCAL loContainer, loControl
    
      loContainer = THIS.PARENT
    
      WITH loContainer
        *** If the parent continer doesn't have the nOriginalHeight and nOriginalWidth properties
        *** then add them and save the form dimensions
        IF NOT PEMSTATUS( loContainer, 'nOriginalHeight', 5 )
          .ADDPROPERTY( 'nOriginalHeight', .HEIGHT )
        ENDIF
        IF NOT PEMSTATUS( loContainer, 'nOriginalWidth', 5 )
          .ADDPROPERTY( 'nOriginalWidth', .WIDTH )
        ENDIF
    
        *** Set a minimun Width and Height to avoid errors later if not
        *** already set
        IF .MINWIDTH = -1
          .MINWIDTH  = .WIDTH / 2
        ENDIF
        IF .MINHEIGHT = -1
          .MINHEIGHT = .HEIGHT / 2
        ENDIF
    
        *** Now save the relevant visual properties (height, width, columnwidths, etc)
        *** of all the controls on the parent container
        FOR EACH loControl IN .CONTROLS
          THIS.saveoriginaldimensions( loControl )
        ENDFOR
      ENDWITH
      ENDPROC
    
    
    ENDDEFINE
    
    
    
    
    Drop the resizer on the base form class in its Init() like so:
    
    
    *** Add the resizer
    This.NewObject( 'Resizer', 'stdResizer', 'stdCustom.vcx' )
    DODEFAULT()
    
    
    

    • Proposed as answer by Tom BorgmannEditor Thursday, September 10, 2015 8:05 AM
    • Marked as answer by Youjun Tang Wednesday, September 16, 2015 10:06 AM
    Wednesday, September 9, 2015 2:42 PM
  • Hi Deepak,

    if you're using an older version of VFP than 9, then Benny's solution might be the best.

    OTOH, when using VFP 9 you could have a look at the ANCHOR property that's availlable for each form object. It offers automatic (codeless) resizing of objects on your form. However, it doesn't zoom the fonts, it only manipulates top, left, height and width of form objects relative to the form dimensions.

    HTH


    Gruss / Best regards
    -Tom
    Debugging is twice as hard as writing the code in the first place.
    Therefore, if you write the code as cleverly as possible,
    you are, by definition, not smart enough to debug it. 010101100100011001010000011110000101001001101111011000110110101101110011

    Thursday, September 10, 2015 8:09 AM
    Answerer