|When you are opening a window you may need to disable some of the menu/toolbar
items due to application security or just because the item is not available until some
other action has been performed (for example the delete icon when there are no rows). Its
quite easy to disable the menu items because the user cannot see them until the menu
header is clicked. Unfortunately PowerBuilder shows the toolbar of your sheet before the
open event of you window is called. One way to stop this effect is to switch off redraw to
the MDI frame before you open the sheet and then switch it back when the window has been
displayed. This has unfortunate side effects if the sheet takes more than a fraction of a
second to open (and most do!).
A solution to this problem is to stop the toolbar from
being displayed until you are ready for it to be displayed. To do this you need to make
the toolbar invisible by default and then make it visible once your window has opened. To
do this goto the properties page for the window and under toolbar make sure the visible
attribute is unchecked.
Then in your windows open event you can disable the toolbar items and then make the
toolbar visible as the last thing you do in the open event.