Ppt lesson 11

1,010
-1

Published on

0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
1,010
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
21
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Ppt lesson 11

  1. 1. Microsoft Visual Basic 2005 BASICS Lesson 11 List Boxes, For Next Loops, and Label Settings
  2. 2. Objectives Use the ListBox control to show multiple lines of information. Use For Next loops. Nest For Next loops. Change label font settings.
  3. 3. Using the ListBox Control ListBox control Enables you to display a list of items to the user Add information to a ListBox Use the Items.Add method Remove all items added to a ListBox Use the Items.Clear method
  4. 4. Using the ListBox Control (cont.)
  5. 5. Using For Next Loops For Next loop Specifically designed for repeating a block of code a specific number of times Always begins with a For statement and ends with a Next statement Always involves a Counter variable
  6. 6. Using For Next Loops (cont.)
  7. 7. Using the Step Keyword to Count Forward Step keyword Used to cause the loop counter to count by an increment other than one
  8. 8. Using the Step Keyword to Count Backward Use a negative value After the Step keyword to count backward
  9. 9. Nesting For Next Loops For Next loops can be nested Within other For Next loops or within Do loops When you nest For Next loops Each nested loop must be completely contained within the outer loop
  10. 10. Nesting For Next Loops (cont.)
  11. 11. Changing Label Font Settings Control the font, style, and size Using the Font property of the label control You can make labels appear in any font installed on your computer.
  12. 12. Changing Label Font Settings (cont.)
  13. 13. Changing Label Font Settings (cont.)
  14. 14. Summary Visual Basic 2005 includes a ListBox control for displaying lists of information. The Items.Add method adds items to a ListBox control. The Items.Clear method removes all entries in a ListBox control. A For Next loop is specifically designed for repeating a block of code a specific number of times.
  15. 15. Summary (cont.) A For Next loop always begins with a For statement and ends with a Next statement. The statements between the For and Next statements are repeated the number of times specified in the For Next loop. For Next loops always involve a Counter variable.
  16. 16. Summary (cont.) If you want a For Next loop to count by an increment other than 1, you can use the Step keyword. The Step keyword can also be used to make a For Next loop count backward. For Next loops can be nested.
  17. 17. Summary (cont.) Indenting your code can help make nested For Next loops easier to read. You can also use Next statements that specify the counter variable of the loop. You can use the Font property to change the font, style, and size of a label.
  1. A particular slide catching your eye?

    Clipping is a handy way to collect important slides you want to go back to later.

×