Ehab, This is my simple modify sample: dialog.prg 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 ...