by AHF » Wed Nov 14, 2007 10:27 am
Antonio,
Right! Here it is :
METHOD Center() CLASS TDMdiChild //own class redefinition
LOCAL nLargura,nAltura,ntop,nleft
LOCAL nlrgmain,naltmain
LOCAL meioljan, meiolmain,meioajan,meioamain
nlargura := ::nwidth() //dialog width
naltura := ::nheight() //dialog height
nlrgmain := Wmain():owndclient:nwidth() //container width
naltmain := Wmain():owndclient:nheight()//container height
//middle of each dialog and container
meioljan := nlargura /2
meioajan := naltura /2
meiolmain := nlrgmain /2
meioamain := naltmain/2
//coordinates to place the mdichild
ntop := meioamain-meioajan
nleft := meiolmain-meioljan
WndTop( ::hWnd, ntop )
WndLeft( ::hWnd, nleft )
RETURN nil
Antonio