-3
I have a stackpanel with several radiobuttons on it, depending on the user input some of these radiobuttons are hidden (visibility property = visibility.Hidden). I would like as this happens, the stackpanel (or other component) organizes the radiobuttons so that the visible ones go up the list and the hidden ones go down. What happens nowadays is that I hide the radiobuttons, but even hidden they remain at the top of the list, making the visible ones stay below.
For Each item As RadioButton In spItens.Children
If Not item.Content.ToString.Contains(txtBusca.Text) Then
item.Visibility = Visibility.Hidden
ElseIf txtBusca.Text = "" Then
item.Visibility = Visibility.Visible
End If
Next
Thanks for your help, but I couldn’t find the 'Location' property on radiobutton.
– Fernando Fragoso
So @Fernandofragoso, this is kind of weird because I don’t recognize this property "Visibility", just "Visible", but anyway,when you enter the properties of the control, don’t have something like "Location"? A field containing the values "X" and "Y"?
– Heitor Badotti
No. Remembering that I am doing in WPF, which differs somewhat from VB.NET windows Forms.
– Fernando Fragoso
@Fernandofragoso I got it, I looked on the internet here and the property "Location" in WPF is the same as "Margin", I made the change in the original answer, give a look to see if now it will work...
– Heitor Badotti
@Fernandofragoso It worked?
– Heitor Badotti