c# - What is the appropriate way to manage and name forms in a solution? -


i beginner visual studio 2015 , c# , looking general advice not not find anywhere else, please bear me.

let's create new windows forms application, in solution explorer can see form1.cs has been added tree, , child form1.designer.cs , form1.

now want add form right clicking windowsformapplication1 , add > new item...

the solution explorer looks this:

enter image description here


for first c# project recreating notepad should not overly difficult, allow me familiarize myself language , syntax etc.

i have added second form project go to line number form, shown edit menu in notepad.

suppose want give form1 , form2 more meaningful names correct way this?

from properties inspector named form1 frmmain , form2 frmgoto noticed in solution explorer parent names still form1.cs , form2.cs:

enter image description here

so right clicked each parent node , renamed them so:

enter image description here


my question right or wrong approach? feel going have naming conflicts maybe.

to test tried showing frmgoto form so:

form frmgoto = new frmgoto(); frmgoto.showdialog(); 

i think did right, frmgoto show correctly have doubts regarding way renamed forms both property inspector , solution explorer.

was there wrong did above, should have used separate naming conventions property inspector form name , solution explorer name etc? run problems naming forms did above?

i suppose looking clarity how best rename forms within solution?

what did not wrong, there easier solution build visual studio solution explorer. right click on item , select rename:

enter image description here

visual studio ask if want perform project-wide rename classname of form:

enter image description here

by answering yes, should in order.


Comments

Popular posts from this blog

Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.12:test (default-test) on project.Error occurred in starting fork -

windows - Debug iNetMgr.exe unhandle exception System.Management.Automation.CmdletInvocationException -

configurationsection - activeMq-5.13.3 setup configurations for wildfly 10.0.0 -