I have finally worked out a solution to this. I hope there is not a rule on line limits. If so, I will gladly edit my post to attach the code as a file instead.
Effectively, my approach was not to hide the controls, but rather count how many lines would go into those controls if I did show the...