Jump to content

Recommended Posts

Posted

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.

 

Posted
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

  • Like 1
  • Thanks 1

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...