在Visual Basic .NET中是否有任何函数可以将GroupBox
内的按钮设为AcceptButton
,但只有其他表单控件才能与GroupBox
共享? / p>
我只看到主表单上的选项,并且Enter事件似乎没有任何内容。
是否有人尝试为此功能编写代码?
答案 0 :(得分:2)
您可以尝试根据进入和离开GroupBox重置表单的AcceptButton属性:
Private Sub GroupBox1_Enter(sender As Object, e As EventArgs) _
Handles GroupBox1.Enter
Me.AcceptButton = Button2
End Sub
Private Sub GroupBox1_Leave(sender As Object, e As EventArgs) _
Handles GroupBox1.Leave
Me.AcceptButton = Button1
End Sub