首页 > 解决方案 > 当用户在文本框控件上按 Enter 时,如何抑制烦人的哔哔声?

问题描述

在 VS2019/Visual Basic 中,如何抑制用户在文本框控件中输入数据时出现的铃声(哔声)?

这是代码。

提前致谢。

Private Sub TxtJumpTo_KeyPress(sender As Object, e As KeyPressEventArgs) Handles TxtJumpTo.KeyPress
        If e.KeyChar = ControlChars.Cr Then
            'Do things
            Else
                'Else do other things
            End If
            'Reset the text box
            TxtJumpTo.Text = ""
        End If
End Sub

标签: vb.net

解决方案


推荐阅读