kkelchev Posted March 15 Posted March 15 Hi. There is a case when we need to HIDE (completely) control such "TUniMainMenu" - application main-menu. Main menu should not be visible at all. If did try as: FreeAndNil(MainForm.MainMenu) in "UniFormCreate" event but result is EXCEPTION. Execute FreeAndNil(MainForm.MainMenu) latter: there is NO efect. Is it possible this to be done. Thanks Kamen. Quote
Abaksoft Posted March 16 Posted March 16 On 3/15/2026 at 9:28 AM, kkelchev said: Is it possible this to be done. Thanks Kamen. Yes, Thx to Sherzod. procedure TMainForm.UniFormCreate(Sender: TObject); begin // user is define on MainModule (at start session) if MainModule.UniMainModule.user <>'admin' then begin // Thx to Sherzod @FMSOFT with JSInterface do JSAddListener('afterrender', 'function(me){me.getRefItems().forEach(function(item){if (item.xtype && item.xtype=="toolbar"){item.hide()}})}', WebForm.JSForm); end; end; Hide_MainMenu.7z 1 1 Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.