winform control event handler method (automatically generated) name and naming conflict issues

When we drag a control from the Toolbox, here for Buttonexample, the default name for button1
Here Insert Picture Description
the code designer can see

private System.Windows.Forms.Button button1;

It is easy to understand, Buttonis a class, we actually creates Buttonan instance of it, so the first letter lowercase name is no problem, also in line with our usual programming practice.
But when we double-click this button, vs created automatically Clickapproach, we can see

private void button1_Click(object sender, EventArgs e)
{

}

Method name first letter should be capitalized, it will prompt the following recommendations
Here Insert Picture Description
Although the program will not be affected, but bloggers looked a little uncomfortable
just vs can help us solve this problem
navigate to: 工具=>选项=>windows窗体设计器
the following settings can:
Here Insert Picture Description

Published 62 original articles · won praise 68 · views 160 000 +

Guess you like

Origin blog.csdn.net/ZUFE_ZXh/article/details/104606031