I want to set the maxheight and width properties and then control form size if user uses the maximize button. Setting these properties works if user uses mouse to drag and resize forms but not if using the maxbutton. I tried putting following code in resize but didn't work so any suggestions would be appreciated.
IF THISFORM.MaxHeight<>-1
IF THISFORM.Height>THISFORM.MaxHeight
THISFORM.Height=THISFORM.MaxHeight
ENDIF
ENDIF
IF THISFORM.MaxWIDTH<>-1
IF THISFORM.WIDTH>THISFORM.MaxWIDTH
THISFORM.WIDTH=THISFORM.MaxWIDTH
ENDIF
ENDIF
THISFORM.REFRESH
IF THISFORM.MaxHeight<>-1
IF THISFORM.Height>THISFORM.MaxHeight
THISFORM.Height=THISFORM.MaxHeight
ENDIF
ENDIF
IF THISFORM.MaxWIDTH<>-1
IF THISFORM.WIDTH>THISFORM.MaxWIDTH
THISFORM.WIDTH=THISFORM.MaxWIDTH
ENDIF
ENDIF
THISFORM.REFRESH