170 likes | 265 Views
CS 2340 Programming in VB.NET. Notes Folder. S:CoursesCSSEibrahimaCS2340Notes Folder Section1 Folder Section2. Programming Rules. Web Site. Create a New Project. Start MS Visual Studio 2012 New Project… Visual Basic Windows Windows Form Application Name: ibrahima_XXXn.
E N D
Notes Folder S:\Courses\CSSE\ibrahima\CS2340\Notes Folder Section1 Folder Section2
Programming Rules Web Site
Create a New Project • Start MS Visual Studio 2012 • New Project… • Visual Basic • Windows • Windows Form Application • Name: ibrahima_XXXn
Save Project and Solution Make sure you know where is your program! • Save all • Create Solution folder: Uncheck • Browse location • Could change project / solution names • Check program location
Reopen an Existing Project • Double click the project file • Double click the solution file • Open MS Visual Studio, then Open project Recent projects
Windows Controls TextBox Get Input Display Output Label Display Information / Output Button User action . . .
Label • Name: lblName • Font • Name • Size • Bold • Italic • Strikeout • Underline • Size • AutoSize • TextAlign • . . .
TextBox • Name: txtName • Size • Multiline • ReadyOnly • BackColor • TabStop • TabIndex • . . .
Button • Name: btnHello • Text • TextAlign • Size • TabStop • TabIndex • . . .
Changing TabIndex • Menu View • Tab Order • Clicking the controls in order to change TabIndex • Close Tab Order • Multiple controls could receive the same TabIndex value
Menu Format • Align • Tops • Lefts • ... • Make Same Size
Menu Format • Horizontal Spacing • Vertical Spacing • Center in Form • Horizontally • Vertically
Menu Format • Order • Bring to Front • Send to Back • Lock Controls
Click Event • The button’s Click Event Users click a button when they want to do something. • Event Procedure Will be called when the event happens. • We will write the event procedure • Event procedure template Double click the button Select Events on Properties Windows
Event Procedure Pseudo Code Declare variables Get Input Process Data Output Result
String Operations ‘ Operators “&” and “+” append strings MessageBox.Show("Hello, " & theName + "!”) MessageBox.Show("Hello, " & theName + "!","Lab 1”, _ MessageBoxButtons.OK, _ MessageBoxIcon.Information)