I have a complicated Winform. I use a lot of tabs to reduce complexity, but there is a small problem that I do not know how to solve.
Suppose I have a winform screen called "Example.cs". I have a lot of TABLES on the screen. In each tab, I have a button "F2 - Save." When the user presses the F2 button, I shoot and do below
protected override bool ProcessCmdKey(ref Message msg, Keys keyData) { if (keyData == (Keys.F2)) { btn_save.PerformClick(); return true; } return base.ProcessCmdKey(ref msg, keyData); }
how should I find the button click event that the user intends to trigger, since there are many save buttons in the same WinForm?
Thanks.
source share