表单启动时,慢慢从中间往四周变大散开[分享CSDN看到]
* 建立1个表单,表单的 ShowWindow = 2,WindowState = 2
* 在表单建立1个定时器 Timer1,Interval=10,Enabled=.f.
* 表单 init 中
DECLARE Long CreateRectRgn IN WIN32API Long, Long, Long, Long
DECLARE Long GetWindowRgn IN WIN32API Long, Long @
DECLARE Long SetWindowRgn IN WIN32API Long, Long, Long
This.AddProperty( 'cw', 0 )
This.AddProperty( 'hRgn', 0 )
m.hRgn = 0
GetWindowRgn( This.hWnd, @ m.hRgn )
This.hRgn = m.hRgn
m.hRgn = CreateRectRgn( 0, 0, 1, 1 )
SetWindowRgn( This.hWnd, m.hRgn, 1 )
* 表单 show 中
This.Timer1.Enabled = .T.
* 定时器 Timer1.Timer 中
WITH Thisform
IF ( .cw < SYSMETRIC(1)/2 ) OR ( .cw < SYSMETRIC(2)/2 )
.cw = .cw + 10
m.hRgn = CreateRectRgn( SYSMETRIC(1)/2-.cw, SYSMETRIC(2)/2-.cw,SYSMETRIC(1)/2+.cw, SYSMETRIC(2)/2+.cw )
SetWindowRgn( .hWnd, m.hRgn, 1 )
ELSE
This.Interval = 0
This.Enabled = .F.
SetWindowRgn( .hWnd, .hRgn, 1 )
ENDIF
ENDWITH