禁用' Ding'在进入

时间:2015-08-29 03:58:18

标签: vb.net

尝试停用' ding'从文本框中输入时发出声音。

我的代码:

Private Sub StoreNumberBox_KeyUp(ByVal sender As System.Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles StoreNumberBox.KeyUp

        If BackgroundWorker1.IsBusy Then
            Exit Sub
        Else
            If e.KeyCode = Keys.Enter Then
                ClearTextBox(Me)
                PullIPs()
            End If
        End If
    End Sub

现在,在我得到一堆令人讨厌的克之前。我用Google搜索了这个问题,所有结果都回来了添加以下代码:

Private Sub StoreNumberBox_KeyUp(ByVal sender As System.Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles StoreNumberBox.KeyUp

    If BackgroundWorker1.IsBusy Then
        Exit Sub
    Else
        If e.KeyCode = Keys.Enter Then
            e.SuppressKeyPress = True 'add me
            ClearTextBox(Me)
            PullIPs()
        End If
    End If
End Sub

以上代码对我没什么影响。我做错了什么,还是有其他选择?

0 个答案:

没有答案