0
votes

I'm new to wpf and see that there's no SendToFront() method to send controls to the front/focused. My scenario has 3 group boxes on top of each other hidden/visible depending on what radio button is selected but with the way Groupboxes are it's only showing one groupbox regardless of visiblity/enabling other groupboxes.

Is there a way around this?

1

1 Answers

0
votes

In VB.Net .. and tested too

Assume that you have 3 groupboxes with the same size and same location

To show and hide them (no need to be disabled):

Private Sub radInsert_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles radInsert.CheckedChanged
    If radInsert.Checked Then
        grpInsert.Visible = True
        grpQuery.Visible = False
        grpUpdate.Visible = False
    End If
End Sub

Private Sub radQuery_CheckedChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles radQuery.CheckedChanged
    If radQuery.Checked Then
        grpInsert.Visible = False
        grpQuery.Visible = True
        grpUpdate.Visible = False
    End If
End Sub

Private Sub radUpdate_CheckedChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles radUpdate.CheckedChanged
    If radUpdate.Checked Then
        grpInsert.Visible = False
        grpQuery.Visible = False
        grpUpdate.Visible = True
    End If
End Sub