Download presentation
Presentation is loading. Please wait.
1
Visual Studio 2010 Hello World CSC 230
2
Go to Start/All Programs/Microsoft Visual Studio 2010/Microsoft Visual Studio 2010
CSC 230
3
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
4
This takes awhile the first time you are working at a particular computer
CSC 230
5
Click on New Project on the start Page or go to File/New/Project
CSC 230
6
Use the New Project dialog box to give the project a name
CSC 230
7
Use the Browse button next to Location to determine where your project will be saved.
CSC 230
8
After establishing a name and location click OK
CSC 230
9
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
10
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
11
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
12
Change the Text property of the form.
CSC 230
13
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
14
Select the Button icon from the Toolbox (left hand) and drag (an instance of) a button onto the form. CSC 230
15
With the button highlighted, go to the Properties Window and change the button’s (Name) property
CSC 230
16
Highlight a label from the Toolbox and drag it onto the form
CSC 230
17
With the label on the form highlighted change the (Name) property of the label in the Properties Window. CSC 230
18
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
19
Change the label’s BorderStyle property to FixedSingle
CSC 230
20
Change the label’s TextAlign property to MiddleCenter
CSC 230
21
Click on the ellipsis button next to the Font Property, and use the dialog box to change the Font Size property. CSC 230
22
Empty out the label’s Text property.
CSC 230
23
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
24
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
25
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
26
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
27
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
28
Type an equal sign followed by some text inside double quotes
CSC 230
29
SAVE! CSC 230
30
RUN! CSC 230
31
Result of running program
Before button is clicked After button is clicked CSC 230
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.