Groupboxes SendToFront()vb.net wpf

时间:2013-05-17 13:40:06

标签: wpf vb.net groupbox

我是wpf的新手,看到没有SendToFront()方法将控件发送到前端/聚焦。我的场景中有3个组合框彼此隐藏/可见,具体取决于选择的单选按钮,但是Groupboxes的方式只显示一个组框,无论是否可见/启用其他组框。

有解决方法吗?

1 个答案:

答案 0 :(得分:0)

在VB.Net中也经过测试

假设您有3个具有相同大小和相同位置的分组框

显示和隐藏它们(无需禁用):

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