Presentation is loading. Please wait.

Presentation is loading. Please wait.

The Professional Touch Programming Right from the Start with Visual Basic.NET 1/e 10.

Similar presentations


Presentation on theme: "The Professional Touch Programming Right from the Start with Visual Basic.NET 1/e 10."— Presentation transcript:

1 The Professional Touch Programming Right from the Start with Visual Basic.NET 1/e 10

2 Crews/Murphy – Programming Right from the Start with Visual Basic.NET 1/e – ©2004 Prentice Hall 2 Objectives Create and work with menus Create and work with Font and Color Dialog boxes Create and work with Print and PrintPreview Dialog boxes

3 Crews/Murphy – Programming Right from the Start with Visual Basic.NET 1/e – ©2004 Prentice Hall 3 Objectives (cont.) Perform simple text file input/output (I/O) Add Multimedia controls to your application Develop applications that combine standard dialogs, text file I/O, and multimedia

4 Crews/Murphy – Programming Right from the Start with Visual Basic.NET 1/e – ©2004 Prentice Hall 4 10-1 Menus A menu is a list of common operations presented to the user in a well-defined, system-universal format. The main menu is a horizontal menu that is permanently visible during the lifetime of the application.

5 Crews/Murphy – Programming Right from the Start with Visual Basic.NET 1/e – ©2004 Prentice Hall 5 Creating Menus Visual Studio provides a Menu Designer that makes it easy to add a main menu to your application. The first step is to add a MainMenu control to your solution.

6 Crews/Murphy – Programming Right from the Start with Visual Basic.NET 1/e – ©2004 Prentice Hall 6 Creating Menus (cont.)

7 Crews/Murphy – Programming Right from the Start with Visual Basic.NET 1/e – ©2004 Prentice Hall 7 Writing Code for Menu Items

8 Crews/Murphy – Programming Right from the Start with Visual Basic.NET 1/e – ©2004 Prentice Hall 8 10-2 Standard Dialog Boxes Another professional touch for your application is the use of standard dialog boxes for tasks such as working with fonts, colors, printing, and files. Dialog boxes can be created at design time or programatically as they are needed.

9 Crews/Murphy – Programming Right from the Start with Visual Basic.NET 1/e – ©2004 Prentice Hall 9 10-3 Font and Color Dialogs The ColorDialog control represents a preconfigured dialog that displays the standard “Color” dialog box, allowing the user to select a color or define a custom color. To display the color dialog box, call the ShowDialog method.

10 Crews/Murphy – Programming Right from the Start with Visual Basic.NET 1/e – ©2004 Prentice Hall 10 10-3 Font and Color Dialogs (cont.)

11 Crews/Murphy – Programming Right from the Start with Visual Basic.NET 1/e – ©2004 Prentice Hall 11 10-3 Font and Color Dialogs (cont.) The FontDialog control represents a preconfigured dialog that displays the standard Font dialog box. To display the font dialog box, call the ShowDialog method.

12 Crews/Murphy – Programming Right from the Start with Visual Basic.NET 1/e – ©2004 Prentice Hall 12 10-3 Font and Color Dialogs (cont.)

13 Crews/Murphy – Programming Right from the Start with Visual Basic.NET 1/e – ©2004 Prentice Hall 13 10-4 Text File Input/Output The OpenFileDialog control represents a preconfigured dialog for selecting a file to be opened. The SaveFileDialog control shares much of the behavior of the OpenFileDialog control, including capturing a string value for FileName.

14 Crews/Murphy – Programming Right from the Start with Visual Basic.NET 1/e – ©2004 Prentice Hall 14 Streaming Data To transfer data between the application and a file, you must write your own data transfer logic. The StreamReader class is designed for character input. The file to be read from can be opened using the File.OpenText(path) function.

15 Crews/Murphy – Programming Right from the Start with Visual Basic.NET 1/e – ©2004 Prentice Hall 15 Streaming Data (cont.)

16 Crews/Murphy – Programming Right from the Start with Visual Basic.NET 1/e – ©2004 Prentice Hall 16 Streaming Data (cont.) The StreamWriter class is also designed for character output. The file to be written to can be assigned using the File.CreateText(path) function.

17 Crews/Murphy – Programming Right from the Start with Visual Basic.NET 1/e – ©2004 Prentice Hall 17 Streaming Data (cont.)

18 Crews/Murphy – Programming Right from the Start with Visual Basic.NET 1/e – ©2004 Prentice Hall 18 10-5 Print and PrintPreview Dialogs The PrintDialog control is a preconfigured dialog box used to select a printer, choose the pages to print, and determine other print-related settings in Windows applications.

19 Crews/Murphy – Programming Right from the Start with Visual Basic.NET 1/e – ©2004 Prentice Hall 19 10-5 Print and PrintPreview Dialogs (cont.) The PrintPreview control is a preconfigured dialog box used to display how the document will appear when printed. The PageSetupDialog control is a preconfigured dialog box that allows users to manipulate page settings, including margins and paper orientation.

20 Crews/Murphy – Programming Right from the Start with Visual Basic.NET 1/e – ©2004 Prentice Hall 20 10-6 Multimedia The Windows Media Player control plays video and sound files in many different formats. The media player is not part of the standard toolbox, but it can be added from the Tools menu.

21 Crews/Murphy – Programming Right from the Start with Visual Basic.NET 1/e – ©2004 Prentice Hall 21 Chapter Summary A menu is a list of common operations presented to the user in a graphical format. Visual Studio provides a series of dialog controls, which provide significant functionality with little effort.

22 Crews/Murphy – Programming Right from the Start with Visual Basic.NET 1/e – ©2004 Prentice Hall 22 Chapter Summary (cont.) The StreamReader class is designed for character input. The Windows Media Player control plays video and sound files in many different formats.

23 The Professional Touch Programming Right from the Start with Visual Basic.NET 1/e 10


Download ppt "The Professional Touch Programming Right from the Start with Visual Basic.NET 1/e 10."

Similar presentations


Ads by Google