That happens when all 3 buttons are assigned to the same event. Select the 2 wrong buttons and delete their event in the properties window. Now doubleclicking one of them will create a new code template for it.. You probably had the three all selected when you created the 1st event..
Double-clicking a button doesn't open its code-behind
-
20-07-2023 - |
Question
I'm making a windows form using c# and added 3 buttons. When I double click on any object, it takes me to the code, the specific function that gets called when that object is activated, depending on its type. However, when I double click on the 2nd or 3rd buttons, it takes me to button 1's code instead of opening the function called by double clicking on the button I pressed.
Help?
Solution
OTHER TIPS
Remove the button click events via the properties window for each button and re-assign them apart.
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow