microsoft visual basic 2015 chapter 06

61 115 0
 microsoft  visual basic 2015 chapter 06

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

Thông tin tài liệu

Microsoft Visual Basic 2015 CHAPTER SIX Loop Structures Objectives ►Add a MenuStrip object ►Use the InputBox function ►Display data using the ListBox object ►Add a Background Image ►Understand the use of counters and accumulators ►Understand the use of compound operators Chapter 6: Loop Structures â 2016 Cengage Learningđ May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part Objectives ►Repeat a process using a For…Next loop ►Repeat a process using a Do loop ►Avoid infinite loops ►Prime a loop ►Validate data Chapter 6: Loop Structures © 2016 Cengage Learning® May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part Objectives ►Create a nested loop ►Select the best type of loop ►Debug using DataTips at breakpoints ►Publish a finished application using ClickOnce technology Chapter 6: Loop Structures © 2016 Cengage Learning® May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part Introduction ► A fundamental process in a computer program is to repeat a series of instructions either while a condition is true (or not true) or until a condition is true (or not true) ► The process of repeating a set of instructions while a condition is true or until a condition is true is called looping • Another term for looping is iteration Chapter 6: Loop Structures â 2016 Cengage Learningđ May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part User Interface Design ►A menu bar is a strip across the top of a window that contains one or more menu names ►A menu is a group of commands, or items, presented in a list Chapter 6: Loop Structures â 2016 Cengage Learningđ May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part 6 User Interface Design ► With a Windows Form object open in the Visual Studio window, scroll in the Toolbox to display the Menus & Toolbars category If the category is not open, tap or click the expand icon (the rightpointing triangle) next to the Menus & Toolbars category name Drag the MenuStrip NET component to the Windows Form object ► Release the object ► With the MenuStrip object selected, scroll in the Properties window until the (Name) property is visible Change the MenuStrip object name to mnuFitness ► Tap or click the Type Here box on the menu bar Type &File to identify the File menu, and then press the ENTER key Chapter 6: Loop Structures © 2016 Cengage Learning® May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part User Interface Design ► Tap or click File in the MenuStrip object to select it, scroll in the Properties window to the (Name) property, and then change the name to mnuFile ► To add a menu item to the File menu, tap or click the Type Here box below the File menu name Type &Clear and then press ENTER to create a new menu item named Clear with C as the hot key ► On the File menu, tap or click Clear to select it, scroll in the Properties window until the (Name) property is visible, and then change the name to mnuClear Chapter 6: Loop Structures © 2016 Cengage Learning® May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part User Interface Design Chapter 6: Loop Structures â 2016 Cengage Learningđ May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part Event Handlers for Menu Items ►In Design view, double-tap or double-click the Exit menu item to open the code window ►Using IntelliSense, enter the Close procedure call to close the window and terminate the application Chapter 6: Loop Structures â 2016 Cengage Learningđ May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part 10 Using a DataTip with Breakpoints ► With the application open in the code window, press and hold or right-click line 46, which contains the code where you want to set a breakpoint, and then point to Breakpoint on the shortcut menu ► Tap or click Insert Breakpoint on the submenu ► To run and test the program with the breakpoint, tap or click the Start Debugging button on the Standard toolbar ► Tap or click the Enter Weight Loss button Type 3.4 as the weight loss amount of the first team member ► Tap or click the OK button in the input box Chapter 6: Loop Structures © 2016 Cengage Learning® May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part 47 Using a DataTip with Breakpoints ►Point to the variable decWeightLoss on line 46 ►You can view the value in any other variable within execution scope by pointing to that variable To illustrate, point to the variable decTotalWeightLoss on line 46 ►Continue the program by tapping or clicking the Continue button on the Standard toolbar Notice that the Continue button is the same as the Start Debugging button ►Point to the decTotalWeightLoss variable Chapter 6: Loop Structures © 2016 Cengage Learning® May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part 48 Using a DataTip with Breakpoints Chapter 6: Loop Structures â 2016 Cengage Learningđ May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part 49 Using a DataTip with Breakpoints ►To remove a breakpoint, press and hold or right-click the statement containing the breakpoint, and then point to Breakpoint on the shortcut menu ►Tap or click Delete Breakpoint on the Breakpoint submenu Chapter 6: Loop Structures © 2016 Cengage Learning® May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part 50 Publishing an Application with ClickOnce Deployment ►After an application is completely debugged and working properly, you can deploy the project ►Deploying a project means placing an executable version of the program on your hard disk, on a web server, or on a network server ►When programming using Visual Basic 2015, you can create a deployed program by using ClickOnce Deployment ►The deployed version of the program you create can be installed and executed on any computer that has the NET framework installed Chapter 6: Loop Structures © 2016 Cengage Learning® May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part 51 Publishing an Application with ClickOnce Deployment ► With the application open, tap or click Build on the menu bar ► Tap or click Publish Fitness Challenge on the Build menu ► Change the default location from publish\ to a file location To publish to a USB drive, type the drive letter Tap or click the Next button ► If necessary, tap or click the From a CD-ROM or DVD-ROM radio button, and then tap or click the Next button ► If necessary, tap or click the “The application will not check for updates” radio button, and then tap or click the Next button Chapter 6: Loop Structures â 2016 Cengage Learningđ May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part 52 Publishing an Application with ClickOnce Deployment ► Tap or click the Finish button ► To view the finished result, minimize the Visual Studio window and then open the Search charm Type Computer in the Search box Double-tap or double-click the USB drive icon to view the published installation folder ► To install the application, double-tap or double-click the setup file ► After installation, the program runs To run the installed application again, open the Search charm, type Fitness, and then click the Fitness Challenge icon Chapter 6: Loop Structures â 2016 Cengage Learningđ May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part 53 Publishing an Application with ClickOnce Deployment Chapter 6: Loop Structures © 2016 Cengage Learning® May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part 54 Program Design Chapter 6: Loop Structures â 2016 Cengage Learningđ May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part 55 Program Design Chapter 6: Loop Structures â 2016 Cengage Learningđ May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part 56 Event Planning Document Chapter 6: Loop Structures â 2016 Cengage Learningđ May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part 57 Summary ►Add a MenuStrip object ►Use the InputBox function ►Display data using the ListBox object ►Add a Background Image ►Understand the use of counters and accumulators ►Understand the use of compound operators Chapter 6: Loop Structures â 2016 Cengage Learningđ May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part 58 Summary ►Repeat a process using a For…Next loop ►Repeat a process using a Do loop ►Avoid infinite loops ►Prime a loop ►Validate data Chapter 6: Loop Structures © 2016 Cengage Learning® May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part 59 Summary ►Create a nested loop ►Select the best type of loop ►Debug using DataTips at breakpoints ►Publish a finished application using ClickOnce technology Chapter 6: Loop Structures © 2016 Cengage Learning® May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part 60 Microsoft Visual Basic 2015 CHAPTER SIX COMPLETE Loop Structures ... publicly accessible website, in whole or in part 10 ► Inserting Standard Items for a Menu Visual Basic 2015 contains an Action Tag that allows you to create a full standard menu bar commonly provided... mnuClear Chapter 6: Loop Structures â 2016 Cengage Learningđ May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part User Interface Design Chapter. .. string ("") Chapter 6: Loop Structures â 2016 Cengage Learningđ May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part 13 InputBox Function Chapter

Ngày đăng: 06/02/2018, 10:06

Mục lục

  • Slide 1

  • Objectives

  • Objectives

  • Objectives

  • Introduction

  • User Interface Design

  • User Interface Design

  • User Interface Design

  • User Interface Design

  • Event Handlers for Menu Items

  • Inserting Standard Items for a Menu

  • Inserting Standard Items for a Menu

  • InputBox Function

  • InputBox Function

  • Creating the InputBox Object for Fitness Challenge Application

  • Displaying Data Using the ListBox Object

  • Displaying Data Using the ListBox Object

  • Adding ListBox Items During Design

  • Adding ListBox Items During Design

  • SelectedItem Property

Tài liệu cùng người dùng

Tài liệu liên quan