5

How to get the active sheet menu in PowerBuilder. If I disable menu, it disables the last open sheet menu rather than the active sheet menu?

Terry
  • 6,160
  • 17
  • 16
Waseem Kiyani
  • 51
  • 1
  • 4
  • How did you "disable menu". You must work with sheet menu via `MenuID` sheet instance variable. – Maximus Dec 03 '12 at 17:56
  • 1
    Actually I was not getting menu ID rather I was disabling menu directly by doing m_sheet.file.enabled = false. Now, from your query I tried to get the menu Id and then disable the menu based on the menu ID and its worked. Thanks e.g; m_sheet lm_setupMenu lm_setupMenu = This.menuID lm_setupMenu.m_new.enabled = False – Waseem Kiyani Dec 04 '12 at 14:28
  • You can answer your own question if you want. It might make the question more helpful to others who don't read the comments. – Rich Bianco Jul 13 '17 at 17:34

1 Answers1

1

Waseem Kiyani answered this Dec 4 '12 at 14:28

Actually I was not getting menu ID. Rather, I was disabled the menu directly

m_sheet.file.enabled = false

Thanks to Maximus, I disabled the menu item by using the menu Id.

Example:

m_sheet lm_setupMenu
lm_setupMenu = This.menuID
lm_setupMenu.m_new.enabled = False 
Eric Glenn
  • 389
  • 2
  • 12
  • Hello, based on what is said here, please for a "WindowType=main!" How can I hide the menu to dynamically modify it and then activate it? What you say only works in mdi – Eduardo G. Oct 09 '17 at 07:14
  • 1
    @Eduardo G: I think this is oimportant enough to ask a new question and, maybe, give more details. – Marc Vanhoomissen Oct 10 '17 at 13:33