Resize form based on if subform visible
I have a form with a subform on it. If subform contains no records, it's visible property is false. In that case, I'd like the outer form to shrink so that there isn't a big empty space where the subform was.
The long way to do this would be by setting the position 开发者_运维技巧for all the controls on the form based on whether the subform is visible. However, is there an easier way to do this (maybe with the can grow/ can shrink property)?
Can grow/can shrink does not apply to forms. But for a superquick solution, try putting your subform in the footer of the main form. You can then quickly make your footer visible or not depending on the subform contents.
精彩评论