vgulielmus
Programmer
Unlike the toolbars, a docked form can be undocked.
To prevent that, I cut the window title bar.
Now the docked form cannot be undocked, but only closed.
PUBLIC oFrm
oFrm=CREATEOBJECT("MyForm")
oFrm.show
DEFINE CLASS MyForm as Form
My respects,
Vilhelm-Ion Praisach
To prevent that, I cut the window title bar.
Now the docked form cannot be undocked, but only closed.
PUBLIC oFrm
oFrm=CREATEOBJECT("MyForm")
oFrm.show
DEFINE CLASS MyForm as Form
dockable=1
ADD OBJECT cmd as commandbutton
PROCEDURE init
ENDDEFINEADD OBJECT cmd as commandbutton
PROCEDURE init
This.Dock(2) && dock to the right side
* cut the title bar so the window can be closed with ctrl+f4 but cannot be moved or undocked
Declare Long SetWindowRgn IN WIN32API Long hWnd, Long hRgn, String bRedraw
Declare Long CreateRectRgn IN WIN32API Long X1, Long Y1, Long X2, Long Y2
SetWindowRgn(thisform.hwnd, CreateRectRgn(0,SYSMETRIC(4)+SYSMETRIC(9)/2,This.width+2*SYSMETRIC(3),This.height+2*SYSMETRIC(4)+SYSMETRIC(9)/2), "True")
ENDPROC* cut the title bar so the window can be closed with ctrl+f4 but cannot be moved or undocked
Declare Long SetWindowRgn IN WIN32API Long hWnd, Long hRgn, String bRedraw
Declare Long CreateRectRgn IN WIN32API Long X1, Long Y1, Long X2, Long Y2
SetWindowRgn(thisform.hwnd, CreateRectRgn(0,SYSMETRIC(4)+SYSMETRIC(9)/2,This.width+2*SYSMETRIC(3),This.height+2*SYSMETRIC(4)+SYSMETRIC(9)/2), "True")
My respects,
Vilhelm-Ion Praisach