Sure:
a) You cannot keep the user from resizing the form, but you can make the form return automatically to the max size it should be by means of this simple code:
method menuAction(var eventInfo MenuEvent)
var
it smallint
endvar
it=eventinfo.id()
switch
case it = MenuControlRestore:
autosize()
case it = MenuControlSize:
autosize()
endswitch
endmethod
method autosize()
var
x,y,w,h longint
scroll longint
border longint
title longint
wconst longint
hconst longint
endvar
scroll=longint(getRegistryValue ("Control Panel\\Desktop\\WindowMetrics","ScrollWidth",RegKe yCurrentUser))
scroll=-(scroll) ;/TwipsPerPixel)
border=longint(getRegistryValue ("Control Panel\\Desktop\\WindowMetrics","BorderWidth",RegKe yCurrentUser))
border=-(border) ;/TwipsPerPixel)
title=longint(getRegistryValue ("Control Panel\\Desktop\\WindowMetrics","CaptionHeight",Reg KeyCurrentUser))
title=-(title) ;/TwipsPerPixel)
wconst=(9*TwipsPerPixel) ;7 con riga, 6 senza
hconst=(10*TwipsPerPixel) ;8 con riga, 7 senza
delayscreenupdates(yes)
self.getposition(x,y,w,h)
tmppt1=self.size
tmppt2=self.nameofabutton.container.size
switch
;Out in the low right angle
case tmppt1.x() > tmppt2.x() and tmppt1.y() > tmppt2.y():
w=tmppt2.x() + (border*2) + wconst
h=tmppt2.y() + (border*2) + title + hconst
self.setposition(x,y,w,h)
;out horizontally
case tmppt1.x() > tmppt2.x():
w=tmppt2.x() + scroll + (border*2) + wconst
self.setposition(x,y,w,h)
;out vertically
case tmppt1.y() > tmppt2.y():
h=tmppt2.y() + scroll + title + (border*2) + hconst
self.setposition(x,y,w,h)
;not out
otherwise:
endswitch
delayscreenupdates(no)
endMethod
(You shoud replace the "nameofabutton" with the name of a button or other object that's containesd in the page.)
b) Sure, but there's no authomatic means of doing this: you can mess with the zoom property of the form, or you can implement a message passing that will make the resizing of the form resize also any control on it, but this will be much work.