What conventions are usually applied when naming Forms and controls?
What will be an ideal response?
Usually, you want to provide reasonable Name property values for all the controls you place on a Form. Although any identifier that starts with a letter is legal, note the following conventions:
* Start control names with a lowercase letter and use camel casing as appropriate.
* Start Form names with an uppercase letter and use camel casing as appropriate. A Form is a class and, by convention, C# class names start with an uppercase letter.
* Use the type of the object in the name. For example, use names such as okButton, firstValueTextBox, or ArithmeticForm.
* Professional programmers usually do not retain the default names for Forms and controls. An exception is sometimes made for Labels that never change. For example, if three labels provide directions or explanations to the user and are never altered during a program's execution, many programmers would approve of retaining their names as label1, label2, and label3.
Most often, you will want to name controls as soon as you add them to a Form. If you rename a control after you have created an event for it, the event code will generate errors. To fix this, you must refactor the code.
You might also like to view...
What does pressing Tab in the last cell of a table do?
A) Moves to the next line in the cell B) Adds a new row C) Inserts a new column D) Saves the table
Which of the following is not a data type used to represent a floating point value
A. float B. double C. long double D. short