by ShumingWang » Wed Jun 27, 2007 1:14 am
Hi,
1.Modify dialog.prg:
add
METHOD Autoresize(ntop,nleft)
local i,rsl0,rsl1,oCtrol,aRect
DEFAULT ntop:=0
DEFAULT nleft:=0
rsl0:=getsysmetrics(0)/800
if rsl0<=1; return ; end //<=800*600, not needed
rsl1:=getsysmetrics(1)/600
for i:=1 TO LEN(::acontrols)
oCtrol = ::aControls[i]
aRect = GetCoors( oCtrol:hWnd )
if oCtrol:classname()=="TCOMBOBOX"
oCtrol:Move( aRect[1]*rsl0, aRect[2]*rsl1)
else
oCtrol:Move( aRect[1]*rsl0, aRect[2]*rsl1, (aRect[4] - aRect[2])*rsl0, (aRect[3] - aRect[1])*rsl1, .t. )
end
next
aRect = GetWndRect( ::hWnd )
::Move( ntop,nleft,::nWidth*rsl0, ::nHeight*rsl1, .T. )
if ::lCentered
WndCenter( ::hWnd )
else
if Empty( ::cResName )
::Move( ::nTop, ::nLeft )
endif
endif
return
2. on app
activate dialog mydialog on init mydialog:autoresize()
3. need enhance , on 1280*800 wider screen , it's not work fine,it must set to normail, like 1280*1024, 1024*768, 800*600.
Regards
Shuming Wang