[英]How do I prevent the textedit box from beeping when enter is pressed?
我正在開發的Windows Form C#應用程序中有一個文本編輯字段,該函數發生后,Windows叮叮。 我找到了一些解決方案,但它僅適用於C ++,我無法弄清楚如何將其轉換為零,因為它是char和非法的轉換,即使我確實將其強制轉換為char,它仍然會發出嗶聲。
任何幫助是極大的贊賞!
private void txtPhrase_KeyPress(object sender, KeyPressEventArgs e)
{
if (e.KeyChar == (char)13)
{
// keyPress seems to initiate the system beep. Why?
btnSpeak_Click(sender, e);
}
}
您必須防止擊鍵到達本機控件。 設置e.Handled = true
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.