McGraw-Hill/Irwin Programming in Visual Basic 6.0 © 2002 The McGraw-Hill Companies, Inc. All rights reserved. Update Edition Chapter 2 More Controls.

Slides:



Advertisements
Similar presentations
VISUAL BASIC Visual Basic is derived from the Basic language (Beginner’s All-Purpose Symbolic Instruction Code) Visual Basic uses an event-driven programming.
Advertisements

Using Macros and Visual Basic for Applications (VBA) with Excel
Microsoft Visual Basic: Reloaded Chapter Five More on the Selection Structure.
Chapter 3.1 Controls Programming In Visual Basic.NET.
Chapter 2 More Controls Programming In Visual Basic.NET.
CHAPTER TWO Creating Simple Visual Basic.NET Windows Applications.
Visual Basic 2010 How to Program. © by Pearson Education, Inc. All Rights Reserved.2.
Visual Basic 2010 How to Program Reference: Instructor: Maysoon Bin Duwais slides Visual Basic 2010 how to program by Deitel © by Pearson Education,
1.
IS 1181 IS 118 Introduction to Development Tools VB Chapter 03.
Introducing More Controls Text boxCheck box Option button Command button frame image.
Flowchart Start Input weight and height
Text Box controls are used when users are required to type some input (during program execution), or output is displayed on the form (known as the user-
To type the VB code behind the command button (named cmdPush), Double-Click on the Push Me (caption) command button As a result the Visual Basic Code Window.
Chapter 2 User Interface Design Copyright © 2011 by The McGraw-Hill Companies, Inc. All Rights Reserved. McGraw-Hill.
With Microsoft Access 2010 © 2011 Pearson Education, Inc. Publishing as Prentice Hall1 PowerPoint Presentation to Accompany GO! with Microsoft ® Access.
110-C1 Chapter 2 of the text: _ text boxes, group boxes, check boxes, radio buttons, picture boxes _ defining access keys tab sequence setting the focus.
Access Ch 5 Review.
Controls General Discussion. VB Controls Visual Basic Controls A control is the generic name for any object placed on a form Controls may be images,
1 ADVANCED MICROSOFT WORD Lesson 15 – Creating Forms and Working with Web Documents Microsoft Office 2003: Advanced.
Chapter 2 User Interface Design Copyright © 2011 by The McGraw-Hill Companies, Inc. All Rights Reserved. McGraw-Hill.
CHAPTER TWO Creating Simple Visual Basic.NET Windows Applications.
Chapter 2 More Controls Programming in C#. NET © 2003 by The McGraw-Hill Companies, Inc. All rights reserved.
Clearly Visual Basic: Programming with Visual Basic 2008 Chapter 4 I Need a Tour Guide.
Chapter 5 Menus, Common Dialog Boxes, and Methods Programming in C#.NET © 2003 by The McGraw-Hill Companies, Inc. All rights reserved.
Tutorial 7 Creating Forms. Objectives Session 7.1 – Create an HTML form – Insert fields for text – Add labels for form elements – Create radio buttons.
A lesson approach © 2011 The McGraw-Hill Companies, Inc. All rights reserved. a lesson approach Microsoft® Excel 2010 © 2011 The McGraw-Hill Companies,
Chapter 2 - More Controls More controls – Text boxes - used for user input – Frames - containers to group items – check boxes - user select an option -
Basic Controls & Properties Chapter 2. Overview u VB-IDE u Basic Controls  Command Button  Label  Text Box  Picture Box u Program Editor  Setting.
Copyright © 2001 by Wiley. All rights reserved. Chapter 2: Using Visual Basic to Create a First Project Getting Started with VB Development Environment.
 Application – another name for a program.  Interface – is what appears on the screen when the application is running.  Program Code – is instructions.
Chapter One An Introduction to Visual Basic 2010 Programming with Microsoft Visual Basic th Edition.
Chapter Two Designing Applications Programming with Microsoft Visual Basic th Edition.
CHAPTER TWO Creating Simple Visual Basic.NET Windows Applications.
Working with the VB IDE. Running a Program u Clicking the”start” tool begins the program u The “break” tool pauses a program in mid-execution u The “end”
2-1 aslkjdhfalskhjfgalsdkfhalskdhjfglaskdhjflaskdhjfglaksjdhflakshflaksdhjfglaksjhflaksjhf.
IS437: Spring 2006 Instructor: Dr. Boris Jukic Controls.
Chapter Two Creating a First Project in Visual Basic.
Chapter 2 P. 1 Introducing more controls (on the Toolbox) (Fig. 2.1) - Text box - Frame - Option button - Check box - Image Example P. 44 Figure 2.2 Message.
Chapter 2 – Introduction to the Visual Studio .NET IDE
© Copyright 2012 by Pearson Education, Inc. All Rights Reserved. Chapter 9 GUI Programming Using Tkinter 1.
CHAPTER:07 JAVA IDE PROGRAMMING-II Prepared By Prepared By : VINAY ALEXANDER ( विनय अलेक्सजेंड़र ) PGT(CS),KV JHAGRAKHAND.
INSERT BOOK COVER 1Copyright © 2012 Pearson Education, Inc. Publishing as Prentice Hall. Exploring Getting Started with VBA for Microsoft Office 2010 by.
Visual Basic Programming Introduction VB is one of the High level language VB has evolved from the BASIC language. BASIC stands for Beginners All-purpose.
More User Interface Controls User interface controls are located in the toolbox. Click the +/- signs to open/ close the different tabs of the tollbox.
McGraw-Hill © 2010 The McGraw-Hill Companies, Inc. All rights reserved. Chapter 2 User Interface Design.
2-1 aslkjdhfalskhjfgalsdkfhalskdhjfglaskdhjflaskdhjfglaksjdhflakshflaksdhjfglaksjhflaksjhf.
McGraw-Hill © 2009 The McGraw-Hill Companies, Inc. All rights reserved. Chapter 2 User Interface Design.
McGraw-Hill/Irwin Programming in Visual Basic 6.0 © 2002 The McGraw-Hill Companies, Inc. All rights reserved. Update Edition Chapter 2 More Controls.
More Form Tools Combo Box (displays a list) Check Box (yes/no) Frame (groups option buttons) Option Button (exclusive choice) Ref Edit (user selects cells)
Object-Oriented Application Development Using VB.NET 1 Chapter 10 VB.NET GUI Components Overview.
VB Objects & Events (Exercises) School of Business Eastern Illinois University © Abdou Illia, Spring 2003 (Week 3, Friday 1/31/2003)
Copyright (c) 2003 by Prentice Hall Provided By: Qasim Al- ajmi Chapter 3 Some Visual Basic Controls and Events Visual Basic. NET.
CMPF114 Computer Literacy Chapter 3 The Visual Basic Environment 1.
Controls. Common properties Height – Height of the control Left – Left of the control Width – width of a control Top - From the screen top Font – Foreground.
Irwin/McGraw-Hill Copyright© 2000 by the McGraw-Hill Companies, Inc. PowerPoint® Presentation to accompany prepared by James T. Perry University of San.
Chapter 20. Copyright 2003, Paradigm Publishing Inc. CHAPTER 20 BACKNEXTEND 20-2 LINKS TO OBJECTIVES Create, Format, and Customize Drawn Objects Create,
Chapter 2 More Controls Programming in C#. NET Objectives Use text boxes, group boxes, check boxes, radio buttons, and picture boxes effectively.
Addison Wesley is an imprint of © 2011 Pearson Addison-Wesley. All rights reserved. Chapter 2 Creating Applications with Visual Basic.
Chapter 15: Customizing Forms. McGraw-Hill/Irwin © The McGraw-Hill Companies, Inc., Customizing Forms Chapter 15 starts Part 4 of the book:
Chapter 5 Introduction To Form Builder. Lesson C Objectives  Use sequences to automatically generate primary key values in a form  Create lists of values.
TOOLBOX. The Toolbox Intrinsic Controls - always included in the Toolbox ActiveX Controls - separate files with ocx file extension Insertable Objects.
McGraw-Hill/Irwin The Interactive Computing Series © 2002 The McGraw-Hill Companies, Inc. All rights reserved. Microsoft Excel 2002 Lesson 4 Inserting.
 2002 Prentice Hall. All rights reserved. 1 Introduction to the Visual Studio.NET IDE Outline Introduction Visual Studio.NET Integrated Development Environment.
Dive Into® Visual Basic 2010 Express
Introduction to Computing
Chapter 2 User Interface Design
Chapter 4 Enhancing the Graphical User Interface
Chapter 4 Enhancing the Graphical User Interface
Presentation transcript:

McGraw-Hill/Irwin Programming in Visual Basic 6.0 © 2002 The McGraw-Hill Companies, Inc. All rights reserved. Update Edition Chapter 2 More Controls

Programming in Visual Basic 6.0 Update Edition © 2002 The McGraw-Hill Companies, Inc. All rights reserved. 2 McGraw-Hill/Irwin More Controls Introducing more controls Working with multiple controls Designing your applications for user convenience Coding for the controls Programming hints

Programming in Visual Basic 6.0 Update Edition © 2002 The McGraw-Hill Companies, Inc. All rights reserved. 3 McGraw-Hill/Irwin Introducing More Controls Labels: lblName.Caption=txtName.Text Text boxes: txtName.Text=“French” Frames: Groups option buttons Check boxes: chkName.Value=0, 1 or 2.caption is name Option buttons: optButton.value=True or False Images

Programming in Visual Basic 6.0 Update Edition © 2002 The McGraw-Hill Companies, Inc. All rights reserved. 4 McGraw-Hill/Irwin Tools Introduced in Chapter 2 Check box Frame Shape Image Option button Text box Line

Programming in Visual Basic 6.0 Update Edition © 2002 The McGraw-Hill Companies, Inc. All rights reserved. 5 McGraw-Hill/Irwin Text Boxes Default property is.Text –txtLastName = “Frockmeister” sets.Text prop. Alignment property –0 (left) –1 (right) –2 (center) The Multiline property must be true, otherwise the alignment is ignored.

Programming in Visual Basic 6.0 Update Edition © 2002 The McGraw-Hill Companies, Inc. All rights reserved. 6 McGraw-Hill/Irwin Frames Frames are containers for option buttons and check boxes Frames establish the mutually exclusive nature of buttons: Frame Option buttons

Programming in Visual Basic 6.0 Update Edition © 2002 The McGraw-Hill Companies, Inc. All rights reserved. 7 McGraw-Hill/Irwin Check Boxes Select or deselect Yes/No options Default property is.Value Example: chkPrint.Value = 0 (no) 0 = no, 1 = yes (checked), 2=disabled check box

Programming in Visual Basic 6.0 Update Edition © 2002 The McGraw-Hill Companies, Inc. All rights reserved. 8 McGraw-Hill/Irwin Option Buttons Used for mutually exclusive choices such as color choices or Print All, Print Selection, or Print One Page Default property is.Value (0 or 1) Names: optBlue, optFontSize Option buttons

Programming in Visual Basic 6.0 Update Edition © 2002 The McGraw-Hill Companies, Inc. All rights reserved. 9 McGraw-Hill/Irwin Images An image holds a picture (not an OLE object) Properties: –.Picture (the file name of an image to display) –.Stretch (picture fills control) –.Visible (true/false makes it appear/disappear) Example: imgFlag.Visible = False

Programming in Visual Basic 6.0 Update Edition © 2002 The McGraw-Hill Companies, Inc. All rights reserved. 10 McGraw-Hill/Irwin Shape Control Shape control places rectangles, squares, ovals, circles, or other shapes on a form Shape is determined by.Shape property Shape property value

Programming in Visual Basic 6.0 Update Edition © 2002 The McGraw-Hill Companies, Inc. All rights reserved. 11 McGraw-Hill/Irwin Line Control Draw lines on a form to separate elements Name example: linLogo A Line has very few properties: –BorderStyle –BorderWidth –BorderColor

Programming in Visual Basic 6.0 Update Edition © 2002 The McGraw-Hill Companies, Inc. All rights reserved. 12 McGraw-Hill/Irwin Working with Multiple Controls Selecting multiple controls Deselecting a group of controls Moving controls as a group Setting properties for multiple controls Aligning controls

Programming in Visual Basic 6.0 Update Edition © 2002 The McGraw-Hill Companies, Inc. All rights reserved. 13 McGraw-Hill/Irwin Designing Your Applications for User Convenience Designing the user interface Defining keyboard access keys (Exit) Setting command button Default and Cancel properties.Default = True or False.Cancel = True or False Setting the tab order property of controls –TabStop property (.Enabled = yes) –TabIndex property (a value beginning at 0)

Programming in Visual Basic 6.0 Update Edition © 2002 The McGraw-Hill Companies, Inc. All rights reserved. 14 McGraw-Hill/Irwin Coding for the controls Clearing text boxes and labels Resetting the focus Setting option buttons/check boxes value properties Changing the font Properties of controls Changing multiple properties of a control Continuing program lines

Programming in Visual Basic 6.0 Update Edition © 2002 The McGraw-Hill Companies, Inc. All rights reserved. 15 McGraw-Hill/Irwin Controls' Default Properties Each control has a default property A default property is the implied property for the object if you omit it following the object: –txtAddress = "1234 Somewhere Street" –chkPrint = True –lstChoice(index) = "14"

Programming in Visual Basic 6.0 Update Edition © 2002 The McGraw-Hill Companies, Inc. All rights reserved. 16 McGraw-Hill/Irwin Programming Hints Check the tab order of an application Use the value property of a check box or option button to set other true/false properties. Ctrl-click a tool to repeatedly use tool Create an option button inside its frame Label controls are “read only” messages Text controls are input/output controls

Programming in Visual Basic 6.0 Update Edition © 2002 The McGraw-Hill Companies, Inc. All rights reserved. 17 McGraw-Hill/Irwin Review Questions - 1 of 2 1. You can display program output in a text box or a label. When should you use a text box? When should you use a label? 2. How does the behavior of option buttons differ from the behavior of check boxes? 3. If you want two groups of option buttons on a form, how can you make the groups operate independently? 4. Explain how to make a graphic appear in an image control. 5. Describe how to select several labels and set them all to 12-point font size in on operation [at design time]. 6. What is the purpose of keyboard access keys? How can you define them in your project? How do they operate at run time? 7. Explain the purpose of the Default and Cancel command button properties. 8. What is the focus? How can you control which object has the focus?

Programming in Visual Basic 6.0 Update Edition © 2002 The McGraw-Hill Companies, Inc. All rights reserved. 18 McGraw-Hill/Irwin Review Questions - 2 of 2 9. How do you force the insertion point appear in a particular text box that may not have the lowest tabindex value? 10. Write the statement to force the focus to be on txtFirstName on a form. 11. What Basic statements will clear the current contents of a text box and a label? 12. Explain how to change a label's Caption to italic at design time and at run time. 13. How are the With and End statements used? Give an example. 14. What is concatenation and when would it be useful? 15. Explain how to continue a very long Basic statement onto another line. 16. What is the default property of a control? Give an example.