Visual Studio 2010 Hello World CSC 230
Go to Start/All Programs/Microsoft Visual Studio 2010/Microsoft Visual Studio 2010 CSC 230
Choose a default environment setting and click Start (I like General because I use Studio for both Visual Basic desktop and web development) CSC 230
This takes awhile the first time you are working at a particular computer CSC 230
Click on New Project on the start Page or go to File/New/Project CSC 230
Use the New Project dialog box to give the project a name CSC 230
Use the Browse button next to Location to determine where your project will be saved. CSC 230
After establishing a name and location click OK CSC 230
Mouse over the Toolbox icon on the left-hand side, then click on the pin icon to lock in place the Tool box that slides out in CSC 230
Determine how to sort the Properties Window on the lower right. The sorting choices are categorized and alphabetical. Currently alphabetical is selected. In addition to properties one can also look at “events” but for now we are interested in properties. CSC 230
Change the (Name) property of the Form by typing in the textbox. A description of the selected property appears at the bottom of the Properties Window. CSC 230
Change the Text property of the form. CSC 230
In the Solution Explorer (upper right) right click on the Form1 In the Solution Explorer (upper right) right click on the Form1.vb file name and change the name of the file but not the extension. CSC 230
Select the Button icon from the Toolbox (left hand) and drag (an instance of) a button onto the form. CSC 230
With the button highlighted, go to the Properties Window and change the button’s (Name) property CSC 230
Highlight a label from the Toolbox and drag it onto the form CSC 230
With the label on the form highlighted change the (Name) property of the label in the Properties Window. CSC 230
Set the label’s AutoSize property to False. The label will now be a fixed size on the form as opposed to adjusting to the size of the text it contains. CSC 230
Change the label’s BorderStyle property to FixedSingle CSC 230
Change the label’s TextAlign property to MiddleCenter CSC 230
Click on the ellipsis button next to the Font Property, and use the dialog box to change the Font Size property. CSC 230
Empty out the label’s Text property. CSC 230
Button Click Routine 1: Double click on the button on the form Creates btnShowMessage_Click subroutine as seen below in “Code View”. Controls have more than one event associated with them. This approach picks out the “default” event. CSC 230
Button Click Routine 2: Go to Code View in the Solution Explorer (upper right); use the left drop-down list to choose the button and the right drop-down list to choose the Click event CSC 230
Button Click Routine 3: Highlight the button on the form, go to the Properties Window and choose the Event list and double click on the Click event. CSC 230
Write a comment about the subroutine Write a comment about the subroutine. Comments start with a single quote and under default setting show up in green A comment does not affect in any way how the program will execute. It’s there to offer some explanation to any human reader of the code. CSC 230
Within the subroutine type the name of the label control followed by a dot; that triggers a drop-down list to appear. Choose “Text” or type “Text” CSC 230
Type an equal sign followed by some text inside double quotes CSC 230
SAVE! CSC 230
RUN! CSC 230
Result of running program Before button is clicked After button is clicked CSC 230