Solved Hide a button when pressing it

yamus

Member
Local time
Today, 12:38
Joined
Aug 12, 2020
Messages
81
Hi
I have a button on the header of a form. when i press it, i get back to the main menu
I want the button to disappear once i'm on the main menu. but i get an error message when i set the visibiity to false from within the button event. The message says "can't hide active control".
Is there any solution or an alternative to solve this problem?
 
I wonder if it would work to set focus elsewhere, then hide it
 
I'm confused. If the form is closing anyway, why do you want to hide the button?
 
I'm confused. If the form is closing anyway, why do you want to hide the button?
the form does not close
there is form B nested in form A. The button "back" is in the header of form A.
When I click on the button "back", form B will be with visible = false and we're back on the main menu which is a part of form A
 
My question is, what would it mean if you pressed the BACK button when on the main form? Why would you have it there in the first place?

I can see having a BACK button on other forms that are in essence children of the main form. Makes perfect sense to have it there. BUT why would you need a BACK button from the main form?
 
I think that is the point, he is only wanting to show the back button when the other form is visible. (covering up form A)
 
If the form isn't visible, they can't see the button anyway??? If this is a subform on a mainform, as Doc said, why would you need a button anyway? You click on a button or you click on a control in the main form. Sounds like the button is redundant.

Anyway, you can probably hide the button in the Lost focus event of the button. But don't forget to make it visible again in the Current event of the subform.
 
I think that is the point, he is only wanting to show the back button when the other form is visible. (covering up form A)
To make a simple explanation. I'll suppose that i have 3 sub forms B,C,D on the main Form A
I have the back button hidden on the header of the main menu and then visible when any of the sub menus is visible and then hidden when i press it to get back to the main menu (sub menus hidden)
 

Users who are viewing this thread

Back
Top Bottom