CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3

Threaded View

  1. #1
    Join Date
    Mar 2015
    Posts
    1

    Enter button creates sound when opening messagebox

    Tried several ways, can't figure out how to disable the 'ding' sound. I know this is basic, but I really can't figure it out. Any advice is greatly appreciated





    This is my button press event.

    Code:
    private void txtResult_KeyDown(object sender, KeyEventArgs e)
            {
                if (e.KeyCode == Keys.Enter)
                {
                    
    
                    if (!String.IsNullOrEmpty(txtResult.Text))
                    {
                        btnCheckAnswer.PerformClick();
                        e.SuppressKeyPress = true;
                        e.Handled = true;
                    }
                   
                }
    
    
            }
    
    
    
    This is one of the btnCheckAnswer.PerformClick() actions
                }
                        }
    
                    }
    
                    else
                    {
                        numRight++;
                        MessageBox.Show("Smarty Pants, You're Right!!");
                        NextQuestion();
                        IncreaseScore();
                    }
                    return;
    
                }
    
            }
    Last edited by Arjay; March 27th, 2015 at 07:10 PM. Reason: Added code tags

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured