• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

11. Windows APIs > 11.1. Remove a Form’s System Menu and Maximize/Minimize Butt...

11.1. Remove a Form’s System Menu and Maximize/Minimize Buttons

Problem

Access makes it easy to remove the control box (often called the system menu) and the minimize and maximize buttons when you design forms, but there doesn’t seem to be a way to do this at runtime. You have an application for which you’d like to be able to remove these buttons to control how users interact with the application. Is there a way to remove these items and then replace them later?

Solution

Removing or replacing these window controls requires changing the style bits for the particular window. Every window maintains a 32-bit value that describes its physical characteristics: for example, its border type and the existence of scrollbars, a system menu, and the minimize and maximize buttons. The values are stored as bit flags, in which the state of a single bit in the 32-bit value indicates the value of some characteristic of the window. In general, you can’t change the state of many of these flags without recreating the window; by setting or clearing the bits in the window’s style value, however, you can force the system menu and the minimize/maximize buttons to appear or disappear.


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint