I have the following code snippet:
if TMenuItem(fmPrincipal.FindComponent('teste')) <> nil then
if TMenuItem(fmPrincipal.FindComponent('teste')).Visible then
...
I look for a menu item and check if it is visible. But my code is growing and I'm having to add more checks if the item is enabled etc.
How could I use a pointer to point to this object and use the pointer from then on, without having to do FindComponent
all the time?