Microsoft Visual Basic 2010 Step by Step eBook
Chapter 10 Creating Modules and Procedures 253 Set the properties shown in the following table for the new label. To help ident ...
254 Part II Programming Fundamentals In Solution Explorer, click Form1 .vb, click the View Designer button, and then double-cli ...
Chapter 10 Creating Modules and Procedures 255 Click End to exit the program. The public variable Wins was useful in the previ ...
256 Part II Programming Fundamentals functions, however, Sub procedures don’t return values associated with their particular Sub ...
Chapter 10 Creating Modules and Procedures 257 a function in a program by placing the function name in a program statement along ...
258 Part II Programming Fundamentals statement that places the final calculation of the function in FunctionName. For example, t ...
Chapter 10 Creating Modules and Procedures 259 Spins to the module. Then you’ll call the HitRate function every time the Spin bu ...
260 Part II Programming Fundamentals Percent = Hits / Tries Return Format(Percent, "0.0%") End Function After you type the first ...
Chapter 10 Creating Modules and Procedures 261 and this value is assigned to the Text property of the lblRate label on the form ...
262 Part II Programming Fundamentals Writing Sub Procedures A Sub procedure is similar to a Function procedure, except that a Su ...
Chapter 10 Creating Modules and Procedures 263 Sub BirthdayGreeting (ByVal Person As String) Dim Msg As String If Person <> ...
264 Part II Programming Fundamentals Using a Sub Procedure to Manage Input Sub procedures are often used to handle input in a pr ...
Chapter 10 Creating Modules and Procedures 265 Object Property Setting TextBox2 Multiline Name ReadOnly ScrollBars TabStop True ...
266 Part II Programming Fundamentals Type the following AddName procedure between the Module Module1 and End Module statements: ...
Chapter 10 Creating Modules and Procedures 267 In the Code Editor, just below the Form1 .vb tab name, click the Class Name arro ...
268 Part II Programming Fundamentals Click the OK button to add the name to the Sales text box. The name appears in the first ...
Chapter 10 Creating Modules and Procedures 269 procedure are passed back to the calling routine. Passing by reference can have s ...
270 Part II Programming Fundamentals By declaring Cost using ByVal, you can safely modify Cost in the CostPlusInterest procedure ...
Chapter 10 Creating Modules and Procedures 271 To Do This Call a Function procedure Type the function name and any necessary arg ...
...
«
10
11
12
13
14
15
16
17
18
19
»
Free download pdf