Recent

Author Topic: The case of the missing menu item  (Read 914 times)

Spoonhorse

  • Full Member
  • ***
  • Posts: 123
The case of the missing menu item
« on: November 09, 2021, 11:23:33 am »
Me again. This one's weird and I think it's on Lazarus. I'm using the latest Lazarus, and Windows 10. I thought it was a minor logic error on my part but now I've looked into it, nope.

The thing is, one of the things on the main menu bar of my app, if you ever make it invisible, will never come visible again. The program thinks it's visible when it should be, it always gives the "right" answer (i.e. the one the program logic thinks it should) if you do this:

Code: Pascal  [Select][+][-]
  1. procedure TForm1.FormClick(Sender: TObject);
  2. begin
  3.   if MenuView.Visible then showmessage('Visible') else showmessage('Invisible');
  4. end;

And if you do this ...

Code: Pascal  [Select][+][-]
  1. procedure TForm1.FormClick(Sender: TObject);
  2. begin
  3.   MenuView.Visible:=not MenuView.Visible;
  4.   if MenuView.Visible then showmessage('Visible') else showmessage('Invisible');
  5. end;  

... then you can sit there turning the Visible property on and off. But on the actual screen, once it's been turned off the first time it never comes back.

As the other menu items don't seem to have this problem, I tried deleting MenuView and all its dependent items and then making new ones with the same names. This didn't help.

Any thoughts, people? Thanks.
« Last Edit: November 09, 2021, 11:29:26 am by Spoonhorse »

AlexTP

  • Hero Member
  • *****
  • Posts: 2386
    • UVviewsoft
Re: The case of the missing menu item
« Reply #1 on: November 09, 2021, 11:31:57 am »

Spoonhorse

  • Full Member
  • ***
  • Posts: 123
Re: The case of the missing menu item
« Reply #2 on: November 09, 2021, 04:37:25 pm »
Oh, thanks.

 

TinyPortal © 2005-2018