Reputation: 2146
I have four text boxes (eg: TexBoxA, B, C and D) in Main.xaml, i set couple of text boxes (eg TexboxB and TextboxC) make it hidden based on the logic in Main.xaml.cs.
Now iam trying to re arrange the text boxes and refill the space made by TextboxB and C. so the form should look like
TextboxA
TextboxD
rather than
TextboxA
(Space-->Hidden TexboxB )
(Space-->Hidden TextboxC)
TextboxD.
Could you please suggest me, what's the best approach in WPF ?
Upvotes: 0
Views: 192
Reputation: 3369
Visibility="Hidden"
will indeed reserve space for the control. What you want is Visibility="Collapsed"
Of course it depends what container your textboxes are in. For StackPanel, WrapPanel, DockPanel or Grid with row height set to "Auto" this should work.
Upvotes: 2