WPPrvFrm - how to disable buttons?

  • The WPPrvFrm does not appear to honor the DisabledButtons property. I looked at the code and it does not do anything with those settings, nor do I see the actual button objects, only the OnClick events for them. So I'm not sure how to modify the form to hide the save, print etc buttons.

    • Offizieller Beitrag

    I see, there was something planned ....

    This code in Execute will fix the problem.

    dia.ToolBar.sel_ActionIcons := [SelSave, SelPrint, SelPrintSetup];

    if wpprvPrint in FDisabledButtons then

    dia.ToolBar.sel_ActionIcons := dia.ToolBar.sel_ActionIcons - [SelPrint];

    if wpprvPrintDialog in FDisabledButtons then

    dia.ToolBar.sel_ActionIcons := dia.ToolBar.sel_ActionIcons - [SelPrintSetup];

    if wpprvSaveAs in FDisabledButtons then

    dia.ToolBar.sel_ActionIcons := dia.ToolBar.sel_ActionIcons - [SelSave];