How to remove the close button of the sub-form. The X in the upper right corner
Private declare function getsystemmenu lib "USER32" (byval hwnd as long, byval brevert as long) as long
Private declare function getmenuitemcount lib "USER32" (byval hmenu as long) as long
Private declare function removemenu lib "USER32" (byval hmenu as long, byval nposition as long, byval wflags as long) as long
Private declare function drawmenubar lib "USER32" (byval hwnd as long) as long
Private const mf_byposition = & H400 &
Private const mf_disabled = & H2 &
Public sub disablex (FRM as form)
Dim hmenu as long, ncount as long
'Obtain the menu handle of the Window System Menu
Hmenu = getsystemmenu (FRM. hwnd, 0)
'Obtain the number of menu items specified by hmenu.
Ncount = getmenuitemcount (hmenu)
'Remove the last menu item from the system menu (the last menu item is 'close ')
Call removemenu (hmenu, ncount-1, mf_disabled or mf_byposition)
'Redraw system menus
Drawmenubar frm. hwnd
End sub
Private sub commandementclick ()
End
End sub
Private sub form_load ()
Disablex me
End sub
Bytes -------------------------------------------------------------------------------------------------------------------------
In the sensitivity window of the window, set controlbox to false.