(VB.NET)在文本框上设置焦点时的msgbox

时间:2014-05-22 05:21:44

标签: vb.net

如果用户点击文本框或选项卡,如何显示消息框?我尝试将消息框放在GotFocus上,每次关闭消息框时它都会生成一个新的消息框

 Private Sub TextBox1_GotFocus(ByVal sender As Object, ByVal e As System.EventArgs) Handles     TextBox1.GotFocus

    MsgBox(" ")
End Sub

1 个答案:

答案 0 :(得分:1)

使用Enter代替......

Private Sub TextBox1_Enter(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox1.Enter
    MsgBox("Please Input A Text")
End Sub