Introduction to the Visual Basic Express 2005IDE

Similar documents
Introductionto the Visual Basic Express 2008 IDE

Dive Into Visual C# 2010 Express

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

Using Visual Basic Studio 2008

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

Full file at Programming in Visual Basic 2010

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

Welcome Application. Introduction to Visual Programming. Outline

2 USING VB.NET TO CREATE A FIRST SOLUTION

Chapter 12: Using Controls

Program and Graphical User Interface Design

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

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

Interface Design in C#

LESSON B. The Toolbox Window

Chapter 7 Inserting Spreadsheets, Charts, and Other Objects

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

Chapter 12: Using Controls

CST242 Windows Forms with C# Page 1

AgWare ClickFORMS 7.0 Introductory Tutorial

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

LESSON A. The Splash Screen Application

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

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

Microsoft Windows 7 - Illustrated Unit A: Introducing Windows 7

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

Visual C# Program: Temperature Conversion Program

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

Microsoft How to Series

Philadelphia University Faculty of Information Technology. Visual Programming

Lesson 6 Adding Graphics

Microsoft Visual C# 2005: Developing Applications Table of Contents

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?

Forms/Distribution Acrobat X Professional. Using the Forms Wizard

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

PowerPoint Basics (Office 2000 PC Version)

Customize the Navigation Pane

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.

Outlook Quick Start Guide

SQL Server 2005: Reporting Services

Lesson Skill Matrix Skill Exam Objective Objective Number

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

Creating Web Applications Using ASP.NET 2.0

Advanced Layout Tools

Microsoft Office Outlook 2007: Intermediate Course 01 Customizing Outlook

REPORT DESIGNER GUIDE

Microsoft PowerPoint 2007 Tutorial

Advanced Layout Tools

Center for Faculty Development and Support Making Documents Accessible

Microsoft PowerPoint 2003 Basic Activities

Using Microsoft Excel

IS2000. Administrative Operator s Guide

Outlook 2010 One. Wednesday, August 7, 9-11 am. Agenda:

Anatomy of a Window (Windows 7, Office 2010)

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

Computer Science 110. NOTES: module 8

USING MICROSOFT ACCESS 2013 Guided Project 7-1

Departme and. Computer. CS Intro to. Science with. Objectives: The main. for a problem. of Programming. Syntax Set of rules Similar to.

Chapter 5. Inserting Objects. Highlights

REPORT DESIGNER GUIDE

Modifying Preferences in Microsoft Outlook 2016 for the PC

Introduction to Microsoft Publisher

Formatting Values. 1. Click the cell(s) with the value(s) to format.

FastTrack Schedule 10. Tutorials. Copyright 2010, AEC Software, Inc. All rights reserved.

Excel 2007 New Features Table of Contents

Skill Exam Objective Objective Number

Outlook Web Access (OWA) Tutorial

1. Adjusting Your Work Area

Outlook 2003, Level 2 Page 1

WINDOWS NT BASICS

First Visual Basic Lab Paycheck-V1.0

Microsoft Outlook 2011: Getting Started

Budget Exercise for Intermediate Excel

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.

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

Poster-making 101 for 1 PowerPoint slide

ADVANCED GroupWise 7.0

Table of Contents. iii

Creating Interactive PDF Forms

EEE-425 Programming Languages (2013) 1

2. In the Start and End Dates section, use the Calendar icon to change the Displayed Start Date to 1/1/2015 and the Displayed End Date to 5/31/2015.

PowerPoint Intermediate 2010

Microsoft Windows 7 is an operating system program that controls:

Word 2007 Tables Objectives

Nauticom NetEditor: A How-to Guide

Working with PDF s. To open a recent file on the Start screen, double click on the file name.

Excel 2016 Basics for Mac

The figure below shows the Dreamweaver Interface.

PARTS OF A WORKSHEET. Rows Run horizontally across a worksheet and are labeled with numbers.

Table of Contents. 1. Creating a Microsoft Excel Workbook...1 EVALUATION COPY

Press the Plus + key to zoom in. Press the Minus - key to zoom out. Scroll the mouse wheel away from you to zoom in; towards you to zoom out.

Outlook 2010 Level 2

Start menu. Toggles between All Programs & Back

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

Transcription:

2 Introduction to the Visual Basic Express 2005IDE OBJECTIVES In this chapter, you will learn The basics of the VisualStudio Integrated Development Environment (IDE) that assists you in writing, running and debugging your VisualBasicprograms. VisualStudio s help features. Seeing is believing. Proverb Form ever follows function. Louis Henri Sullivan Intelligence is the faculty of making artificial objects, especially tools tomake tools. Henri-Louis Bergson Key commands contained in the IDE s menus and toolbars. The purposeof the various kinds of windows in the VisualStudio 2005IDE. What visualprogramming is and how it simplifies and speeds programdevelopment. Tocreate,compile and executea simple VisualBasic program that displays text and an image using the Visual Studio IDE and the techniqueof visualprogramming.

2 Chapter 2 Introduction to the Visual Basic Express 2005 IDE [***Instructor s Manual***] Self-Review Exercises and Answers 2.1 Fill in the blanks in each of the following statements: a) The techniqueof allows programmers tocreateguis without writing any code. ANS: visualprogramming. b) A(n) is agroupofone or moreprojects that collectively formavisualbasic program. ANS: solution. c) The featurehides a window when the mousepointer 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 programmers to browse solution files. ANS: Solution Explorer f) Aplus box indicates that the tree in the Solution Explorer can. ANS: expand. g) The properties in the Properties window canbe sorted or. ANS: alphabetically,categorically. h) Aform s property specifies the text displayed in the form s title bar. ANS: Text. i) The allows programmers to add controls to the form ina visualmanner. ANS: Toolbox. j) Using displays relevant help articles,based on the current context. ANS: Dynamic 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 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. ANS: False. The Toolbox contains icons that represent controls. e) Both forms and Labels havea title bar. ANS: False. Forms have a title bar but Labels do not (although they do have Label text). f) Control properties can bemodified only by writing code. ANS: False. Control properties can be set using the Properties window in design mode. g) PictureBox es typically display images. h) VisualBasic files use the file extension.bas. ANS: False. VisualBasicfiles use the file extension.vb. i) Aform s background color is set using the BackColor property.

Exercises and Answers 3 Exercises and Answers 2.3 Fill in the blanks in each of the following statements: a) When an ellipses button is clicked, a(n) is displayed. ANS: dialog. Dialogs are windows that facilitate user-computer communication. b) To saveevery 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) Acontrol can beadded to aform by double clicking its control icon in the Toolbox. b) The form, Label and PictureBox haveidenticalproperties. ANS: False. Each type of control has adifferent set of properties,although controls can havecommon properties. c) If your machine is connected to the Internet, you canbrowse the Internet from the VisualStudio IDE. d) VisualBasic programmers usually create complex programs without writing any code. ANS: False. Visual Basic programming usually involves acombination 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 mode when aform or control is selected. 2.5 Some features that appear throughout Visual Studio perform similar actions in different contexts.explain and giveexamples of how the plus 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 VisualStudio IDE easier to learnand 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 c) The property determines aform s or control s background color. ANS: BackColor. 2.7 Briefly describeeach of the following IDE features: a) toolbar

4 Chapter 2 Introduction to the Visual Basic Express 2005 IDE ANS: A toolbar contains icons that, when clicked,execute acommand. b) menu bar ANS: Amenu bar contains menus, whicharegroups of related commands. c) Toolbox ANS: The Toolbox contains controls used to customize forms. d) control ANS: Acontrol is a component, such as a PictureBox or Label. Controls are added to aform. e) form ANS: Aform represents the Windows application that you are creating. The form and controls collectively represent the program s GUI. f) solution ANS: A solution is agroupofprojects. [ Note: In the following exercises, you are asked to create GUIs using controls that we have not yet discussed in this book. The exercises will give you practice with visual programming only the programs will not performany actions.you will beplacing controls from the Toolbox on aform to familiarize yourself with what each control looks like. Wehave provided step-by-step instructions for you.if you follow these, you should beable to replicate the screen images weprovide.] 2.8 (Notepad GUI) Create the GUI for the notepad as showninfig. 2.50. MenuStrip RichTextBox Fig. 2.50 Notepad GUI. a) Manipulating the Form s properties. Change the Text property of the Form to My Notepad. b) Adding a MenuStrip to the Form. After inserting the MenuStrip,add items by clicking the Type Here section, typing amenu name (e.g., File, Edit, View and About)and then pressing Enter. c) Adding a RichTextBox to the Form. Change the Size property to 267, 220 or use the sizing handles. Change the Text property to Enter Text Here. Finally, set the Location property to 13, 34.

Exercises and Answers 5 2.9 (Calendar and Appointments GUI) Create the GUI for the calendar as showninfig. 2.51. Label MonthCalendar Label RichTextBox Fig. 2.51 Calendar and Appointments GUI. a) Manipulating the Form s properties. Change the Text property of the Form to My Scheduler.Set the Form s Size property to 332, 470. b) Adding Labels to the Form. Add two Labels to the Form.Both should be ofequal size (178, 21 ) and should be centered in the Form horizontally, as shown. Set the Label s Text properties tomatch the figureas shown, using 12-point font size. Also set 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 appropriateplacebetween the two Labels. 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 showninfig. 2.52. Textbox Buttons Panels Button Fig. 2.52 Calculator GUI.

6 Chapter 2 Introduction to the Visual Basic Express 2005 IDE a) Manipulating the Form s properties. Change the Size property of the Form to 272, 192. Change the Text property of the Form to Calculator.Change the Font property to Tahoma. 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, 21.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 togroup 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 Location property 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. Thereare 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, x, /, -, = and. should have a size of 24, 24.The 00 and OFF Buttons have size 48, 24.The + Button is sized 24, 64.The C (clear) and C/A (clear all) Buttons are sized 32, 24. 2.11 (AlarmClockGUI) Create the GUI for the alarm clock as showninfig. 2.50. GroupBox Button RadioButtons Label Fig. 2.53 AlarmclockGUI. a) Manipulating the Form s properties. Change the Size property of the Form to 256, 176. Change the Text property of the Form to Alarm Clock.Change the Font property to Tahoma. 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, Minute and Second Buttons to 56, 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 248, 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 and Answers 7 d) Adding a GroupBox to the Form. GroupBox es are like Panels, except that GroupBox es can display a title. Change the Text property to AM/PM, and set the Size property to 72, 72. Toplace the GroupBox in the correct location on the Form, set the Location property to 104, 38. 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. 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 tomake the time bold. Change the ForeColor to Silver (located in the Web tab) tomake 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 infig. 2.54. [ Note: All colors used in this exercises arefrom the Web paletteand the image canbefound in the examples folder for Chapter 2.] GroupBox CheckBox es Button TrackBar GroupBox es RadioButtons PictureBox Fig. 2.54 Radio GUI. a) Manipulating the Form s properties. Change the Form s Text property to Radio and the Size to 576, 240.Change the Font property to Tahoma.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, 23. Change the Buttons Text properties to 1, 2, 3, 4, 5, 6, respectively. c) Adding the Speakers GroupBox and CheckBox es. Set the GroupBox s Size to 160, 72, its Text to Speakers and its ForeColor to Black.Set its Location to 280, 16.Add two CheckBox es to the Form.Set each CheckBox s Size to 56, 24.Set the Text properties for the CheckBox es to Rear and Front.

8 Chapter 2 Introduction to the Visual Basic Express 2005 IDE 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, 24.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, 23.Set its Tex t to 92.9.Place the Label as shownin the figure. Add two RadioButtons to the GroupBox. Change the BackColor to PeachPuff and change the Size to 40,24.Set the Text of one to AM and the other s 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)