Introductionto the Visual Basic Express 2008 IDE

Similar documents
Dive Into Visual C# 2010 Express

Introduction to the Visual Basic Express 2005IDE

Full file at

Dive Into Visual C# 2008 Express

Introduction to the Visual Studio.NET Integrated Development Environment IDE. CSC 211 Intermediate Programming

Programming in C# Project 1:

Tutorial 3 - Welcome Application

Chapter 2. Creating Applications with Visual Basic Pearson Addison-Wesley. All rights reserved. Addison Wesley is an imprint of

Tutorial 2 - Welcome Application Introducing, the Visual Studio.NET IDE

Using Visual Basic Studio 2008

Welcome Application. Introducing the Visual Studio.NET IDE. Objectives. Outline

Full file at Programming in Visual Basic 2010

2 USING VB.NET TO CREATE A FIRST SOLUTION

LESSON B. The Toolbox Window

Program and Graphical User Interface Design

LESSON A. The Splash Screen Application

Chapter 12: Using Controls

Controls. By the end of this chapter, student will be able to:

November Copyright 2016 Open Systems Holdings Corp. All rights reserved.

Status Bar: Right click on the Status Bar to add or remove features.

Visual C# Program: Temperature Conversion Program

Week 5 Creating a Calendar. About Tables. Making a Calendar From a Table Template. Week 5 Word 2010

AgWare ClickFORMS 7.0 Introductory Tutorial

Chapter 7 Inserting Spreadsheets, Charts, and Other Objects

Microsoft How to Series

Interface Design in C#

3. The first step in the planning phase of a programming solution is to sketch the user interface.

INTRODUCTION TO VISUAL BASIC 2010

C H A P T E R T W E N T Y E I G H T. Create, close, and open a Web application. Add an image, text box, label, and button to a Web page

Forms/Distribution Acrobat X Professional. Using the Forms Wizard

Microsoft Windows 7 - Illustrated Unit A: Introducing Windows 7

Discovering Computers & Microsoft Office Office 2010 and Windows 7: Essential Concepts and Skills

REPORT DESIGNER GUIDE

While editing a page, a menu bar will appear at the top with the following options:

Using Microsoft Excel

REPORT DESIGNER GUIDE

USING MICROSOFT ACCESS 2013 Guided Project 7-1

Outlook Quick Start Guide

Chapter 12: Using Controls

Nauticom NetEditor: A How-to Guide

Customize the Navigation Pane

CST242 Windows Forms with C# Page 1

11.1 Create Speaker Notes Print a Presentation Package a Presentation PowerPoint Tips... 44

Text box. Command button. 1. Click the tool for the control you choose to draw in this case, the text box.

The insertion point will appear inside the text box. This is where you can begin typing.

Lesson Skill Matrix Skill Exam Objective Objective Number

Sema Foundation ICT Department. Lesson - 18

Microsoft Outlook 2011: Getting Started

PowerPoint Basics (Office 2000 PC Version)

Part I. Integrated Development Environment. Chapter 2: The Solution Explorer, Toolbox, and Properties. Chapter 3: Options and Customizations

IS2000. Administrative Operator s Guide

Using the Web in Mathematics Foundations Course An Introduction to Microsoft PowerPoint Sarah L. Mabrouk, Framingham State College

Chapter 2. Ans. C (p. 55) 2. Which is not a control you can find in the Toolbox? A. Label B. PictureBox C. Properties Window D.

Advanced Layout Tools

Advanced Layout Tools

Introduction Accessing MICS Compiler Learning MICS Compiler CHAPTER 1: Searching for Data Surveys Indicators...

Introduction to Microsoft Excel

Tutorials. Lesson 3 Work with Text

Skill Exam Objective Objective Number

Excel 2016 Basics for Mac

Introduction. Getting Started. Selecting a Template. 1 of 1

Using Microsoft Word. Working With Objects

BEDI INTERNATIONAL SCHOOL, BAREILLY. CHAPTER: 3( Managing files and folders)

Excel Select a template category in the Office.com Templates section. 5. Click the Download button.

SQL Server 2005: Reporting Services

Drawing. Chapter 11. Bridge. A. Insert Views. Step 1. Click File Menu > New, click Drawing and OK. on the View Layout toolbar.

Display Systems International Software Demo Instructions

Outlook basics. Identify user interface elements that you can use to accomplish basic tasks.

Master Pages. Basics 1

Outlook 2010 Level 2

Creating Interactive PDF Forms

Top Producer 7i Tips & Tricks Volume 1

Creating a Flyer. Open Microsoft Publisher. You will see the list of Popular Publication Types. Click the Blank Page Sizes.

Severe Weather Safety PSA

Status Bar: Right click on the Status Bar to add or remove features.

Budget Exercise for Intermediate Excel

Word 2007 Tables Objectives

Visual C# Program: Resistor Sizing Calculator

PowerPoint 2016 Building a Presentation

Chapter 5. Inserting Objects. Highlights

Word 2013 Quick Start Guide

Full file at Chapter 2: Creating a User Interface

Guide to WB Annotations

Visual C# Program: Simple Game 3

The figure below shows the Dreamweaver Interface.

-Using Excel- *The columns are marked by letters, the rows by numbers. For example, A1 designates row A, column 1.

Contents I - Navigating is easy p. 2. III - Controls p. 7. II - Using Whiteboard Active pages: making a new page, saving, opening, printing p.

Chapter11 practice file folder. For more information, see Download the practice files in this book s Introduction.

Lesson 6 Adding Graphics

HTML Exercise 21 Making Simple Rectangular Buttons

Computer Science 110. NOTES: module 8

DEVELOPING DATABASE APPLICATIONS (INTERMEDIATE MICROSOFT ACCESS, X405.5)

Microsoft PowerPoint 2007 Tutorial

CS-Studio Display Builder

Creating a Website with Publisher 2016

Microsoft Excel 2010 Basic

REVIEW OF CHAPTER 1 1

Creating Web Applications Using ASP.NET 2.0

1. What is the definition of a problem? 2. How to solve problems? 3. What is meant by Algorithm? 4. What is a Program testing? 5. What is Flowchart?

Contents. Launching Word

Transcription:

2 Seeing is believing. Proverb Form ever follows function. Louis Henri Sullivan Intelligence is the faculty of making artificial objects, especially tools to make tools. Henri-Louis Bergson Introductionto the Visual Basic Express 2008 IDE OBJECTIVES In this chapter you ll learn: The basics of the Visual Studio Integrated Development Environment (IDE) that assists you in writing, running and debugging your Visual Basic programs. Visual Studio s help features. Key commands contained in the IDE s menus and toolbars. The purpose of the various kinds of windows in the Visual Studio 2008 IDE. What visual programming is and how it simplifies and speeds program development. To create, compile and execute a simple Visual Basic program that displays text and an image using the Visual Studio IDE and the technique of visual programming.

2 Chapter 2 Introduction to the Visual Basic Express 2008 IDE Self-Review Exercises 2.1 Fill in the blanks in each of the following statements: a) The technique of allows you to create GUIs without writing any code. ANS: visual programming. b) A(n) is a group of one or more projects that collectively form a Visual Basic program. ANS: solution. c) The feature hides a window when the mouse pointer is moved outside the window s area. ANS: auto-hide. d) A(n) appears when the mouse pointer hovers over an icon. ANS: tool tip. e) The window allows you to browse solution files. ANS: Solution Explorer f) A plus box indicates that the tree in the Solution Explorer can. ANS: expand. g) The properties in the Properties window can be sorted or. ANS: alphabetically, categorically. h) A Form s property specifies the text displayed in the Form s title bar. ANS: Text. i) The allows you to add controls to the Form in a visual manner. ANS: Toolbox. j) Using displays relevant help articles, based on the current context. ANS: context-sensitive help. k) The property specifies how text is aligned within a Label s boundaries. ANS: TextAlign. 2.2 State whether each of the following is true or false. If false, explain why. a) The title bar of the IDE displays the IDE s mode. b) The X box toggles auto-hide. ANS: False. The pin icon toggles auto-hide. The X box closes a window. c) The toolbar icons represent various menu commands. d) The toolbar contains icons that represent controls you can drag onto a Form. ANS: False. The Toolbox contains icons that represent such controls. e) Both Form s and Labels have a title bar. ANS: False. Form s have a title bar but Labels do not (although they do have Label text). f) Control properties can be modified only by writing code. ANS: False. Control properties can be set using the Properties window. g) PictureBox es typically display images. h) Visual Basic files use the file extension.bas. ANS: False. Visual Basic files use the file extension.vb. i) A Form s background color is set using the BackColor property.

Exercises 3 Exercises 2.3 Fill in the blanks in each of the following statements: a) When an ellipsis button is clicked, a(n) is displayed. ANS: dialog. Dialogs are windows that facilitate user-computer communication. b) To save every file in a solution, select. ANS: File >Save All. c) Using help immediately displays a relevant help article. It can be accessed using the key. ANS: context-sensitive, F1 d) GUI is an acronym for. ANS: graphical user interface. 2.4 State whether each of the following is true or false. If false, explain why. a) You can add a control to a Form by double clicking its control icon in the Toolbox. b) The Form, Label and PictureBox have identical properties. ANS: False. Each type of control has a different set of properties, although controls can have common properties. c) Ifyourmachineis connected totheinternet, you canbrowse theinternet fromthe Visual Studio IDE. d) Visual Basic programmers usually create complex programs without writing any code. ANS: False. Visual Basic programming usually involves a combination of writing a portion of the program code and having Visual Studio generate the remaining code. e) Sizing handles are visible during execution. ANS: False. Sizing handles are present only in Design view when a Form or control is selected. 2.5 Some features that appear throughout Visual Studio perform similar actions in different contexts. Explainand give examples of how theplus and minus boxes, ellipsis buttons, down-arrow buttons and tool tips act in this manner. Why do you think the Visual Studio IDE was designed this way? ANS: An ellipsis button indicates that a dialog will be displayed when the button is clicked. The plus and minus boxes expand and collapse a tree, just as in Windows Explorer. The down-arrow button indicates that there are more options, both for toolbar icons and for items in the Properties window. Moving the mouse pointer over most icons displays the icon s name as a tool tip. These features make the Visual Studio IDE easier to learn and use. 2.6 Fill in the blanks in each of the following statements: a) The property specifies which image a PictureBox displays. ANS: Image. b) The menu contains commands for arranging and displaying windows. ANS: Window 2.7 Briefly describe each of the following IDE features: a) toolbar ANS: A toolbar contains icons that, when clicked, execute a command. b) menu bar ANS: A menu bar contains menus, which are groups of related commands. c) Toolbox ANS: The Toolbox contains controls used to customize forms.

4 Chapter 2 Introduction to the Visual Basic Express 2008 IDE d) control ANS: A control is a component, such as a PictureBox or Label. Controls are added to a Form. e) Form ANS: A Form represents the Windows Forms application that you are creating. The Form and controls collectively represent the program s GUI. f) solution ANS: A solution is a group of projects. [Note: In the following exercises, you are asked to create GUIs using controls that we have not yet discussed in this book. The exercises give you practice with visual programming only the programs do not perform any actions. You place controls from the Toolbox on a Form to familiarize yourself with what each control looks like. We have provided step-by-step instructions for you. If you follow these, you should be able to replicate the screen images we provide.] 2.8 (Notepad GUI) Create the GUI for the notepad as shown in Fig. 2.49. MenuStrip RichTextBox Fig. 2.49 Notepad GUI. a) Manipulating the Form s properties. Change the Text property of the Form to My Notepad. Change the Font property to 9pt Segoe UI. b) Adding a MenuStrip control to the Form. After inserting the MenuStrip, add items by clicking the Type Here section, typing a menu name (e.g., File, Edit, View and About) and then pressing Enter. c) Adding a RichTextBox to the Form. Drag this control onto the Form. Change the Size property to 267, 220 or use the sizing handles. This property specifies the width and height of the control within the window. Change the Text property to Enter Text Here. Finally, set the Location property to 14, 36. This property specifies the location of the top-left corner of the control relative to the top-left corner of the Form.

Exercises 5 2.9 (Calendar and Appointments GUI) Create the GUI for the calendar as shown in Fig.2.50. Label MonthCalendar Label RichTextBox Fig. 2.50 Calendar and appointments GUI. a) Manipulating the Form s properties. Change the Text property of the Form to My Scheduler. Change the Font property to 9pt Segoe UI. Set the Form s Size property to 332, 470. b) Adding Labels to the Form. Add two Label s to the Form. Both should be of equal size ( 231, 23) and should be centered in the Form horizontally, as shown. Set the Label s Text properties to match the figure as shown, using 12-point font size. Alsoset the BackColor property to Yellow. c) Adding a MonthCalendar control to the Form. Add this control to the Form and center it horizontally in the appropriate place between the two Label s. d) Adding a RichTextBox control to the Form. Add a RichTextBox control to the Form and center it below the second Label. Resize the RichTextBox accordingly. 2.10 ( Calculator GUI) Create the GUI for the calculator as shown in Fig. 2.51. TextBox Buttons Panels Button Fig. 2.51 Calculator GUI.

6 Chapter 2 Introduction to the Visual Basic Express 2008 IDE a) Manipulating the Form s properties. Change the Text property of the Form to Calculator. Change the Font property to 9pt Segoe UI. Change the Size property of the Form to 272, 204. b) Adding a TextBox to the Form. Set the TextBox s Text property in the Properties window to 0. Change the Size property to 240, 23. Set the TextAlign property to Right this right aligns text displayed in the TextBox. Finally, set the TextBox s Location property to 8, 16. c) Adding the first Panel to the Form. Panel controls are used to group other controls. Change the Panel s BorderStyle property to Fixed3D to make the inside of the Panel appear recessed. Change the Size property to 88, 112. Finally, set the Locationproperty to 8, 48. This Panel contains the calculator s numeric keys. d) Adding the second Panel to the Form. Change the Panel s BorderStyle property to Fixed3D. Change the Size property to 72, 112. Finally, set the Location property to 112, 48. This Panel contains the calculator s operator keys. e) Adding the third (and last) Panel to the Form. Change the Panel s BorderStyle property to Fixed3D. Change the Size property to 48, 72. Finally, set the Location property to 200, 48. This Panel contains the calculator s C (clear) and C/A (clear all) keys. f) Adding Buttons to the Form. There are 20 Buttons on the calculator. Add a Button to the Panel by dragging and dropping it on the Panel. Change the Text property of each Button to the calculator key it represents. The value you enter in the Text property will appear on the face of the Button. Finally, resize the Buttons, using their Size properties. Each Button labeled 0 9, *, /, -, = and. should have a size of 24, 24. The 00 and OFF Buttons have size 48, 24. The + Button is sized 25, 64. The C (clear) and C/A (clear all) Buttons are sized 38, 24. 2.11 (Alarm Clock GUI) Create the GUI for the alarm clock as shown in Fig. 2.52. GroupBox Button RadioButtons Label Fig. 2.52 Alarm clock GUI. a) Manipulating the Form s properties. Change the Text property of the Form to Alarm Clock. Change the Font property to 9pt Segoe UI. Change the Size property of the Form to 281, 176. b) Adding Buttons to the Form. Add six Buttons to the Form. Change the Text property of each Button to the appropriate text. Change the Size properties of the Hour and Minute Buttons to 60, 23. Set the Size of the Second Button to 65, 23. The ON and OFF Buttons get size 40, 23. The Timer Button gets size 48, 32. Align the Buttons as shown. c) Adding a Label to the Form. Add a Label to the Form. Change the Text property to SNOOZE. Set its Size to 254, 23. Set the Label s TextAlign property to MiddleCenter. Finally, to draw a border around the edge of the Snooze Label, change the BorderStyle property of the Snooze Label to FixedSingle.

Exercises 7 d) Adding a GroupBox to the Form. GroupBox es are like Panels, except that GroupBox es display a title. Change the Text property to AM/PM, and set the Size property to 72, 72. To place the GroupBox in the correct location on the Form, set the Location property to 104, 29. e) Adding AM/PM RadioButtons to the GroupBox. Change the Text property of one RadioButton to AM and the other to PM. Then place the RadioButtons as shown by setting the Location of the AM RadioButton to 16, 16 and that of the PM RadioButton to 16, 40. These coordinates are with respect to the top-left corner of the GroupBox that contains the RadioButtons. Set their Size properties to 48, 24. f) Adding the time Label to the Form. Add a Label to the Form and change its Text property to 00:00:00. Change the BorderStyle property to Fixed3D and the BackColor to Black. Set the Size property to 64, 23. Use the Font property to make the time bold. Change the ForeColor to Silver (located in the Web tab) to make the time stand out against the black background. Set TextAlign to MiddleCenter to center the text in the Label. Position the Label as shown. 2.12 (Radio GUI) Create the GUI for the radio as shown in Fig.2.53. [ Note: All colors used in this exercise are from the Web palette, and the image can be found in the examples folder for Chapter 2.] GroupBox CheckBox es Button TrackBar GroupBox es RadioButtons PictureBox Fig. 2.53 Radio GUI. a) Manipulating the Form s properties. Change the Font property to 9pt Segoe UI. Change the Form s Text property to Radio and the Size to 576, 240. Set BackColor to PeachPuff. b) Adding the Pre-set Stations GroupBox and Buttons. Set the GroupBox s Size to 232, 64, its Text to Pre-set Stations, its ForeColor to Black and its BackColor to RosyBrown. Change its Font to Bold. Finally, set its Location to 24, 16. Add six Buttons to the GroupBox. Set each BackColor to PeachPuff and each Size to 24, 24. Change the Buttons Text properties to 1, 2, 3, 4, 5, 6, respectively.

8 Chapter 2 Introduction to the Visual Basic Express 2008 IDE c) Adding the Speakers GroupBox and CheckBox es. Set the GroupBox s Size to 160, 64, its Text to Speakers and its ForeColor to Black. Set its Location to 280, 16. Add two CheckBox es to the GroupBox. Set each CheckBox s Size to 56, 24. Set the Text properties for the CheckBox es to Rear and Front. d) Adding the Power On/Off Button. Add a Button to the Form. Set its Text to Power On/Off, its BackColor to RosyBrown, its ForeColor to Black and its Size to 72, 64. Change its Font style to Bold. e) Adding the Volume Control GroupBox, the Mute CheckBox and the Volume TrackBar. Add a GroupBox to the Form. Set its Text to Volume Control, its BackColor to RosyBrown, its ForeColor to Black and its Size to 200, 80. Set its Font style to Bold. Add a CheckBox to the GroupBox. Set its Text to Mute and its Size to 56, 19. Add a TrackBar to the GroupBox. f) Adding the Tuning GroupBox, the radio station Label and the AM/FM RadioButtons. Add a GroupBox to the Form. Set its Text to Tuning, its ForeColor to Black and its BackColor to RosyBrown. Set its Font style to Bold and its Size to 216, 80. Add a Label to the Form. Set its BackColor to PeachPuff, its ForeColor to Black, its BorderStyle to FixedSingle, its Font style to Bold, its TextAlign to MiddleCenter and its Size to 56, 24. Set its Tex t to 92.9. Place the Label as shown in the figure. Add two RadioButtons to the GroupBox. Change the BackColor to PeachPuff and change the Size to 45,24. Set the Text of one to AM and of the other to FM. g) Adding the image. Add a PictureBox to the Form. Set its BackColor to Transparent, its SizeMode to StretchImage and its Size to 56, 72. Set the Image property to Music- Note.gif (located in the examples folder for Chapter 2).