This code does not perform any beep, I can assure you. It's somewhere else. You are not showing any code related to the beep. Moreover, you are not showing any code related to the problem. This is because you are asking about clicking on the button, but showing some method which could be used as an event handler you added to some keyboard event of some control. Also, using
PerformClick
is not the best idea. Normally, when you want to have same effect as you would have on the click on a button (or something), quite simply, make it a separate method. It would like this:
void BackHandler() {
}
myBackButton.Click += (sender, eventArgs) => { BackHandler(); };
void SomewhereElse() {
BackHandler();
}
I hope the idea is clear.
OS can beep it if "thinks" you are clicking something non-existing. To check it up, you can change sound scheme to "No sound" (in Control Panel) and see what happens.
—SA