When we drag a control from the Toolbox, here for Button
example, the default name for button1
the code designer can see
private System.Windows.Forms.Button button1;
It is easy to understand, Button
is a class, we actually creates Button
an 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 Click
approach, we can see
private void button1_Click(object sender, EventArgs e)
{
}
Method name first letter should be capitalized, it will prompt the following recommendations
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: