Ah, I am re-reading your original question.
Your onShow method set the element to invisible.
This event is triggered after your method that shows the form is done.
Only option would be to remove the bit that hides the element out of the onShow method and set it yourself when needed.
Or set a variable true/false somewhere that this onShow method checks if to set the element to invisible.