TEAM ENVI^  ForceLocal=1|  ENVI^ EnviMode=1
SET  ::WM_WINDOWPOSCHANGED=0x0047

WIN1
_SUB WIN1,W300H200,随字体自动调整大小,
    CALC &&CH0=200 - 25  //客户区高
    CALC &&CW0=300 - 6   //客户区高
    LABE LABE1,L28T106W270H30,,,
    SET &LH=-1
    ENVI @this.MSG=_%WM_WINDOWPOSCHANGED%::&&wP,&&lP, OnFixWinSize WM_WINDOWPOSCHANGED
    OnFixWinSize init
_END

_SUB OnFixWinSize
    ENVI @this.POS=?&&X1:&&Y1:&&W1:&&H1:&&X0:&&Y0::::&&CW:&&CH
    IFEX $%&X1%<=-32000, EXIT  //最小化 
    CALC  &&H=%&H1% - %&CH%  + %CH0%
    CALC  &&W=%&W1% - %&CW%  + %CW0%
    IFEX $%LH%=%H%, EXIT _SUB   //不必调整
    TEAM SET LH=%H%| ENVI @this.POS=::%&W%:%&H%
    ENVI @LABE1=POS=::%&W%:%&H% [%*]
_END  
