Mastering PowerBuilder

HomePrevious Lesson: Exporting the DataWindow
Next Lesson: Sort Service

Cut, copy, Paste (Special), Clear Services

All these are available as basic services. You may want to turn off the relevant menu options for report DataWindows, as shown below:
// Object: DataWindow user object in the window
// Event: pfc_PreRmbMenu
am_dw.m_table.m_cut.enabled = False
am_dw.m_table.m_copy.enabled = False
am_dw.m_table.m_paste.enabled = False
am_dw.m_table.m_selectall.enabled = False

If you paint a different menu for report windows, then it�s fine. Other wise, write the following code.
// Object: Window that you use for the report
// Event: pfc_PostOpen
This.MenuID.Item[2].Item[1].Enabled = FALSE
This.MenuID.Item[2].Item[3].Enabled = FALSE
This.MenuID.Item[2].Item[4].Enabled = FALSE
This.MenuID.Item[2].Item[5].Enabled = FALSE
This.MenuID.Item[2].Item[6].Enabled = FALSE
This.MenuID.Item[2].Item[7].Enabled = FALSE
This.MenuID.Item[2].Item[9].Enabled = FALSE

We advise you to paint a separate menu for the report windows and hide the options that aren�t required for the report.
HomePrevious Lesson: Exporting the DataWindow
Next Lesson: Sort Service