Tool: vs2008
Step 1:
Open vs, file-New-project;
At this time, if you selected C ++ or other non-C # projects when vs was started for the first time, you can select
"Other languages"-Visual C #-Windows form applicationsProgram
To create a C # project.
In this case, a form1 appears in the workspace, which is very similar to VB.
Step 2:
Open the Toolbox (which can be found on the right side of the workspace) or open it through view-> toolbox.
Step 3:
Place some components on from1, such as a label and a button.
Select the component on form1, right-click the "-" attribute, and you can see: (such as label1)
You can set the default display of the label in the text attribute. The name attribute sets the name of the label (used for calling ). For example, change the text attribute to null and the name attribute to tips.
After the text is set to null, the label will not be visible on form1.
To select it.
Step 4:
Add action.
Double-click button1 to enter the code area.
The button#click (Object sender, eventargs e) function is called when the button is clicked.
Let's assume this action: click the button and "hello, it's elar." is displayed in the label section .".
At this point, you can press F7 to compile the project. The advantage of doing so is that vs can check the newly added components during coding.
For example, the tips component can prompt itself.
AddCodeAs follows:
Last step:
Press F5 or Ctrl + F5, or the small green triangle "start debugging" on the interface. Let's take a look at our hello World.
--------------------------------------------
Tutorial complete ^_^