sysjames Posted February 3, 2021 Share Posted February 3, 2021 I have a TUniPopUpMenu that has several items. I wish to turn the visibility of the items on or off. The Menu is called AccountMenu and a typical item is RenewSubscription1. When I try code such as "AccountMenu.RenewSubscription1.Visible := False; " the IDE tells me that "[dcc32 Error] Main.pas(440): E2003 Undeclared identifier: 'RenewSubscription1'". How do I get to the menu item to turn the visibility feature on or off? Quote Link to comment Share on other sites More sharing options...
Sherzod Posted February 3, 2021 Share Posted February 3, 2021 1 hour ago, sysjames said: I have a TUniPopUpMenu that has several items. I wish to turn the visibility of the items on or off. The Menu is called AccountMenu and a typical item is RenewSubscription1. When I try code such as "AccountMenu.RenewSubscription1.Visible := False; " the IDE tells me that "[dcc32 Error] Main.pas(440): E2003 Undeclared identifier: 'RenewSubscription1'". How can we reproduce this issue? Quote Link to comment Share on other sites More sharing options...
sysjames Posted February 3, 2021 Author Share Posted February 3, 2021 See attached project. BugTest.7z Quote Link to comment Share on other sites More sharing options...
sysjames Posted February 3, 2021 Author Share Posted February 3, 2021 Please disregard. i see i must reference the menu items by position, rather than by name. (I wonder what the name property is used for?). Thanks for all who looked at this. Quote Link to comment Share on other sites More sharing options...
Sherzod Posted February 4, 2021 Share Posted February 4, 2021 6 hours ago, sysjames said: i see i must reference the menu items by position, rather than by name. (I wonder what the name property is used for?). procedure TMainForm.UniFormCreate(Sender: TObject); begin // UniPopupMenu1.One.Visible := False; end; procedure TMainForm.UniFormCreate(Sender: TObject); begin // One.Visible := False; end; Quote Link to comment Share on other sites More sharing options...
sysjames Posted February 4, 2021 Author Share Posted February 4, 2021 How simple the solution was! Thank you Sherzod. I really appreciate you taking the time to straightening me out. 1 Quote Link to comment Share on other sites More sharing options...
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.