Control hide/show(should be post here, right?)
-
I'm creating an user control like treeView, in this control, I want to put a button to let my user control hide/show in Owner form. how could I do? thanks
-
You already posted this question at http://www.codeproject.com/Messages/4548577/Control-hide-show.aspx[^]. Please choose one forum only and stick to it.
Use the best guess
-
I'm creating an user control like treeView, in this control, I want to put a button to let my user control hide/show in Owner form. how could I do? thanks
kenmaMoon wrote:
how could I do?
Toggle the
Visible
property? The problem is a logical one; if you hide the control containing the button to toggle visibility, the user will not be able to make it visible again, as the button that toggles it is invisible too.Bastard Programmer from Hell :suss: If you can't read my code, try converting it here[^]
-
kenmaMoon wrote:
how could I do?
Toggle the
Visible
property? The problem is a logical one; if you hide the control containing the button to toggle visibility, the user will not be able to make it visible again, as the button that toggles it is invisible too.Bastard Programmer from Hell :suss: If you can't read my code, try converting it here[^]
-
thanks for your reply. yes, but the button is in the userControl, next time I want the user control shown by click the button.
kenmaMoon wrote:
yes, but the button is in the userControl, next time I want the user control shown by click the button.
Re-read what I wrote; the button will be invisible if you hide the container it's in. You cannot click an invisible button. Either put the button somewhere else and have it toggle the
Visible
property, or put the button somewhere on location (0,0) and resize the control to shrink to the size of the button. Third, best option; throw the button and the control you wish to show/hide on a new usercontrol.Bastard Programmer from Hell :suss: If you can't read my code, try converting it here[^]