Question:
I can’t seem to clear the default menus in a modal dialog box. I have triedall types of code in the OpenModal() method, but the default menusstill appear. How can I clear the default menus in a modal window?
Answer:
The recommended method to set up menus is the InitializeWindow()method. The InitializeWindow() method is called once when the windowis first created.
To clear all menu bars, you must create a menu bar, use theClearMenuBar() method bar to remove all the menus, and then assignthe cleared menu bar to the form with the SetMenuBar() method. Ifyour form was named frmMenu
, the code would look like:
DIM mbSample AS ObjectmbSample = NEW MenuBarmbSample.ClearMenuBar()frmMenu.SetMenuBar(mbSample)