Working with Intrinsic Controls and ActiveX Controls

Slides:



Advertisements
Similar presentations
Objectives Understand the software development lifecycle Perform calculations Use decision structures Perform data validation Use logical operators Use.
Advertisements

Visual Basic Project Files:.VBP file: Project File: a small text file that contains the names of other files in the project, as well as some information.
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-
CVEV 118/698 Visual Basic Lecture 1 Prof. Mounir Mabsout Expert 1: Elsa Sulukdjian Expert 2: Walid El Asmar.
CVEV 118/698 Visual Basic Lecture 3 Prof. Mounir Mabsout Elsa Sulukdjian Walid El Asmar.
Visual Basic Project 2 IDS 306 Spring 1999 V. Murphy.
Data Types and Operations Programming Fundamentals (Writing Code)Programming Fundamentals (Writing Code)
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.
Introduction to Visual Basic Chulantha Kulasekere.
Adding Controls to User Forms. Adding Controls A user form isn’t much use without some controls We’re going to add controls and write code for them Note.
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,
Microsoft Visual Basic 2010: Reloaded Fourth Edition Chapter One An Introduction to Visual Basic 2010.
Chapter 9 Introduction to ActionScript 3.0. Chapter 9 Lessons 1.Understand ActionScript Work with instances of movie clip symbols 3.Use code snippets.
Visual Basic Chapter 1 Mr. Wangler.
05/09/ Introducing Visual Basic Sequence Programming.
Saeed Ghanbartehrani Summer 2015 Lecture Notes #4: Working with Variables and User Interfaces IE 212: Computational Methods for Industrial Engineering.
Ch 11: Userforms CP212 Winter Topics Designing User Forms o Controls Setting Properties o Tab Order o Testing Writing Event Handlers o Userform_Initialize.
XP New Perspectives on Microsoft Office FrontPage 2003 Tutorial 4 1 Microsoft Office FrontPage 2003 Tutorial 4 – Using Shared Borders and Themes.
5-1 aslkjdhfalskhjfgalsdkfhalskdhjfglaskdhjflaskdhjfglaksjdhflakshflaksdhjfglaksjhflaksjhf.
PMS /134/182 HEX 0886B6 PMS /39/80 HEX 5E2750 PMS /168/180 HEX 00A8B4 PMS /190/40 HEX 66CC33 By Adrian Gardener Date 9 July 2012.
© 2006 Lawrenceville Press Slide 1 Chapter 3 Visual Basic Interface.
Appendices A - F A-F Exploring Microsoft Visual Basic 6.0 Copyright © 1999 Prentice-Hall, Inc. By Carlotta Eaton.
Chapter 5 Menus, Common Dialog Boxes, and Methods Programming in C#.NET © 2003 by The McGraw-Hill Companies, Inc. All rights reserved.
Tutorial 111 The Visual Studio.NET Environment The major differences between Visual Basic 6.0 and Visual Basic.NET are the latter’s support for true object-oriented.
Visual Basic.NET Comprehensive Concepts and Techniques Chapter 5 Decision Making.
Chapter 2 - More Controls More controls – Text boxes - used for user input – Frames - containers to group items – check boxes - user select an option -
Visual Basic.NET Comprehensive Concepts and Techniques Chapter 7 Using Menus, Common Dialogs, Procedures, Functions, and Arrays.
Chapter 9 - VB.Net by Schneider1 Chapter 9 – Additional Controls and Objects 9.1 List Boxes, Combo Boxes, and the File-Opening Control The List Box Control.
 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.
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”
Chapter Two Creating a First Project in Visual Basic.
Data Types and Variables. Data Type! Computers are all about Data! Data can be in the form of Text Dates Sounds Pictures.
Practical Programming COMP153-08S Week 5 Lecture 1: Screen Design Subroutines and Functions.
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.
Chapter 3 w Variables, constants, and calculations DIM statements - declaration temporary memory locations identifier, data type, scope data types - values.
Chapter 4 Variables and constants. 4.1 Variables -Use of variables is good programming style -easier to modify -easier for a programmer to understand.
Visual Basic.NET Comprehensive Concepts and Techniques Chapter 4 Working with Variables, Constants, Data Types, and Expressions.
Slide 1 Using Menu Bar & Common Dialog Boxes. Slide 2 Setting Up the Main Items v First open the form on which you want the menu located v Then start.
COMPUTER PROGRAMMING I 3.02 Apply Properties Associated with the Controls.
Tutorial 3: Using Variables and Constants1 Tutorial 3 Using Variables and Constants.
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.
Variables Hold information that may be manipulated, used to manipulate other information or remembered for later use A storage location in memory (RAM)
Chapter 4 Getting Started with VBA. Subroutines Subroutine is the logical section of code that performs a particular task. Subroutine is also called a.
Creating Menus Menu Bar – behaves like standard Windows menus Can be used in place of or in addition to buttons to execute a procedure Menu items are controls.
BBT 10 Visual Basic 03 Enrichment. Tip Before creating any files for your project, first create a new folder Save all of your files in the folder Pieces.
T U T O R I A L  2009 Pearson Education, Inc. All rights reserved Student Grades Application Introducing Two-Dimensional Arrays and RadioButton.
Variables and Expressions Programming Right from the Start with Visual Basic.NET 1/e 7.
Visual Basic Review LBS 126. VB programming Project Form 1Form 2Form 3 Text boxButton Picture box Objects Text box Button Objects.
Tutorial 81 Field, Record, Data File Field - a single item of information about a person, place, or thing Record - a group of related fields that contain.
Introduction to Programming Using Visual Basic 6.0 Cheryl Klimack
TOOLBOX. The Toolbox Intrinsic Controls - always included in the Toolbox ActiveX Controls - separate files with ocx file extension Insertable Objects.
Visual Basic.NET Comprehensive Concepts and Techniques Chapter 5 Decision Making.
COMPUTER PROGRAMMING I 3.01 Apply Controls Associated With Visual Studio Form.
Making Interactive Programs with Visual Basic .NET
Chapter 4.  Variables – named memory location that stores a value.  Variables allows the use of meaningful names which makes the code easier to read.
Visual Basic/ Visual Studio Brandon Large. Connecting to prior knowledge In your notes write down what the two main parts of the computer are. The “software”
COMPUTER PROGRAMMING I Apply Procedures to Develop List Box and Combo Box Objects.
VISUAL BASIC 6.0 Designed by Mrinal Kanti Nath.
Egyptian Language School Computer Department
Chapter 1: An Introduction to Visual Basic 2015
3.01 Apply Controls Associated With Visual Studio Form
3.01 Apply Controls Associated With Visual Studio Form
VISUAL BASIC FINAL EXAM REVIEW SHEET
VB.NET PROGRAMMING FINAL EXAM TEST REVIEW.
Data Types List Box Combo Box Checkbox Option Box Visual Basic 6.0
Introduction to Programming
Chapter 4 Enhancing the Graphical User Interface
Presentation transcript:

Working with Intrinsic Controls and ActiveX Controls Project 2

Introduction Intrinsic Controls – the basic set of twenty controls in the toolbox. Are a part of the .exe VB program. ActiveX Controls – exists as separate files. Files have a .ocx extension.

Introduction cont………. Many routines and procedures are built into applications that are not designed for the end user.

Creating the Interface Consists of sizing and locating the GUI and then adding the controls necessary for the user to use the form.

Form Size and Position Height and Width property values can change the size of the form. Top and Left property values change the position of the form.

AutoSize and BackStyle Properties AutoSize – when set to True, the size of the control (label) will depend on the size of the caption property. BackStyle – when set to Transparent, the color of the control below the label displays within the label’s border.

Copying Controls You can copy and paste controls. A message will ask you if you want to create a control array. Click “NO” if you just want a copy of the control. We will work with control arrays later on.

ListBox and ComboBox Controls Used to present the end user with choices from a list. When a list is longer than the list box, scroll bars automatically appear.

ListBox and ComboBox Control Appearance of List Selection From List List always shows, scroll bars added if list is longer than box. Click item in list ComboBox(Style = 0) Drop-down list Click item in list or type directly in box. ComboBox(Style=1) List always shows, scroll bar added if list is longer than box. ComboBox(Style=2)

Shape Control Used to add shapes to the form Square Circle Rectangle

CheckBox Control Used to turn controls on or off. Indicate the selection of deselection of check boxes on a form.

Frame Control Used as a container for other controls, such as option buttons. A frame can only have a rectangle shape. A frame can have a caption. When option buttons are added to the frame, only one can be selected at a time.

Option Button Control Presents a set of choices. Placed in groups, such as on a frame control. Must be drawn directly on the frame to be a part of the group.

CommonDialog Control Allows you to add the Open, Save As, Color, Print and Font commands. Not visible during run time. Activate the CommonDialog control by using one of the Show methods.

Aligning Controls Used to align controls in the form. Format menu Vertically Horizontally Format menu

Naming Controls The name of a control is a property of a control. Helps the programmer know what control he/she is working with when writing code. Table 2-2

Writing Code Project 2

Changing Control Properties Basic Format controlname.property = value

Variables Temporary storage locations. Each variable has a Name Data Type – determines the type of data the variable can hold.

Variables cont……….. Must follow these rules when choosing names for variables. The name must begin with a letter. The name cannot be more than 255 characters. Then name cannot contain punctuation or blank spaces.

Declaring Variables You must declare, or create, a variable. This will be done by Explicitly Declaring them. Dim variablename As datatype There can be a wide variety of different data types Byte, date, string, integer, variant, double

Assigning values to a variable Variables can hold one value at a time. We use assignment statements to give variables a value. dblRate = 10.5 strName = “Mr. Preheim”

Variable Scope Refers to whether or not the variable is visible to other sub routines. Variables declared in a sub routine are not visible by other sub routines in the program. Variables declared in the General Declarations are visible to all subroutines for that form.

Arithmetic Expressions Code that contains statements to perform mathematical operations. Order of Precedence – the order in which the calculation will take place. Can change the order of precedence by using parentheses. Refer to table 2-7

Arithmetic Expression Examples dblPayRate = dblHours * curWage dblTotal = intNumber1 + 100

If..Then…Else Statements Used to execute one statement or another based on whether a condition is True or False. A condition is made up of a 2 expressions and a comparison operator. =, <, >, <=, >=, <>

Key words in an If…Then…Else Statement End If

If Statement Structure If condition Then Block of code if the condition is True Else Block of code if the condition is False End If

If Structure Flowchart Example Is Matinee Check Box Checked F T Price = 5 Price = 3.5

If Structure VB Code Example If chkMatinne.Value = 1 Then Price = 3.5 Else Price = 5 End IF

Constants Similar to a variable in the idea that it uses space in memory. However, the value of a constant does not change. Defined by using the Const statement in the General Declarations.

Concatenation The process of adding strings together is called concatenation. Performed by using the ampersand (&) character. Example: textRecord.Text = num & “ ” & cboShow.Text & vbNewLine & txtRecord.Text

Items in a ComboBox When items are added to a ComboBox, they are assigned an Index number. The first item is assigned an index of 0. When an item is selected from the list during runtime, that index number is assigned to the ListIndex property.

Writing Code for the Common Dialog Control To display the Color dialog box, you will apply the ShowColor method.