VISUAL BASIC Controls. Version 1 Trg. Div., NIC HQRs



Similar documents
Excel 2007 Basic knowledge

ACS Version Check Layout Design

Introduction to Visual Basic

Visual Basic and Databases

Introduction to the Visual Studio.NET IDE

What is Microsoft PowerPoint?

Access 2007 Creating Forms Table of Contents

Smart Board Notebook Software A guide for new Smart Board users

Using Microsoft Word. Working With Objects

Using Microsoft Project 2000

Microsoft Excel 2010 Tutorial

Sample Table. Columns. Column 1 Column 2 Column 3 Row 1 Cell 1 Cell 2 Cell 3 Row 2 Cell 4 Cell 5 Cell 6 Row 3 Cell 7 Cell 8 Cell 9.

Welcome to CorelDRAW, a comprehensive vector-based drawing and graphic-design program for the graphics professional.

In this session, we will explain some of the basics of word processing. 1. Start Microsoft Word 11. Edit the Document cut & move

Visual Basic Programming. An Introduction

CREATE A 3D MOVIE IN DIRECTOR

Create Charts in Excel

Working with Visio Connectors

Microsoft Publisher 2010 What s New!

Writer Guide. Chapter 15 Using Forms in Writer

Quick Guide. pdoc Forms Designer. Copyright Topaz Systems Inc. All rights reserved.

Microsoft Access 2010 Overview of Basics

Visual Basic 2010 Essentials

KaleidaGraph Quick Start Guide

PowerPoint 2013: Basic Skills

Introduction to. Microsoft Access Practicals

Creating Fill-able Forms using Acrobat 8.0: Part 1

Task Card #2 SMART Board: Notebook

Avery DesignPro 2000 User Guide

Microsoft Windows Overview Desktop Parts

Chapter 15 Using Forms in Writer

PLAY VIDEO. Close- Closes the file you are working on and takes you back to MicroStation V8i Open File dialog.

Canterbury Maps Quick Start - Drawing and Printing Tools

Windows XP Pro: Basics 1

Information Literacy Program

9 CREATING REPORTS WITH REPORT WIZARD AND REPORT DESIGNER

WIMP: Windows, Icons, Menus (or mice), Pointers (or pull-down menus) Kathy Lynch and Julie Fisher Topic Overview. Suggested Readings.

Communicate: In Print

Internet Explorer 7. Getting Started The Internet Explorer Window. Tabs NEW! Working with the Tab Row. Microsoft QUICK Source

Writer Guide. Chapter 15 Using Forms in Writer

Introduction to the TI-Nspire CX

Introduction to the use of the environment of Microsoft Visual Studio 2008

Fig. 1 The finished UserForm project.

Draw pie charts in Excel

Click on various options: Publications by Wizard Publications by Design Blank Publication

Solutions from SAP. SAP Business One 2005 SP01. User Interface. Standards and Guidelines. January 2006

Microsoft Word 2010 Tutorial

Excel Using Pivot Tables

WHAT S NEW IN WORD 2010 & HOW TO CUSTOMIZE IT

DIA Creating Charts and Diagrams

Windows 8.1 Update 1 Supplement

Operating Systems. and Windows

Petrel TIPS&TRICKS from SCM

The corresponding control ladder program is shown at below: The content of element comment will be built is shown below

Kaplan Higher Education Seminar Student User Guide

Chapter 9 Creating Reports in Excel

In this example, Mrs. Smith is looking to create graphs that represent the ethnic diversity of the 24 students in her 4 th grade class.

User Guide. Ahead Software AG

Microsoft Access Basics

Welcome to CorelDRAW, a comprehensive vector-based drawing and graphic-design program for the graphics professional.

Excel Using Pivot Tables

ZoomText 10.1 for Windows 8 Quick Reference Guide Addendum

8 CREATING FORM WITH FORM WIZARD AND FORM DESIGNER

2. More Use of the Mouse in Windows 7

Working with sections in Word

paragraph(s). The bottom mark is for all following lines in that paragraph. The rectangle below the marks moves both marks at the same time.

Introduction to Measurement Tools

Microsoft PowerPoint Tutorial

Handout: Word 2010 Tips and Shortcuts

Using Rational Rose to Create Object-Oriented Diagrams

Microsoft Word Track Changes

SMART NOTEBOOK 10. Instructional Technology Enhancing ACHievement

Creating a Calendar in CorelDRAW

National RTAP Marketing Transit Toolkit Customizing Templates in Microsoft Publisher

Smart Connection 9 Element Labels

GUIDELINES FOR PREPARING POSTERS USING POWERPOINT PRESENTATION SOFTWARE

RIT Installation Instructions

Introduction to Word 2007

Creating Forms with Acrobat 10

The VB development environment

Changing the Display Frequency During Scanning Within an ImageControls 3 Application

How to make a line graph using Excel 2007

Access 2010: The Navigation Pane

Create a Poster Using Publisher

Introduction to Microsoft Word 2003

Epson Brightlink Interactive Board and Pen Training. Step One: Install the Brightlink Easy Interactive Driver

Chapter 1. Creating Sketches in. the Sketch Mode-I. Evaluation chapter. Logon to for more details. Learning Objectives

Making a Poster Using PowerPoint 2007

How To Create A Checkbox In Visual Basic (For A Powerpoint) With A Check Box At Run Time

PowerPoint 2007: Basics Learning Guide

Test Generator. Creating Tests

Using Excel for Business Analysis: A Guide to Financial Modelling Fundamentals

PEMBINA TRAILS SCHOOL DIVISION. Information Technology Department. Inspiration 7.0

CATIA Basic Concepts TABLE OF CONTENTS

Unit 21 - Creating a Button in Macromedia Flash

Creating and Using Links and Bookmarks in PDF Documents

Transcription:

VISUAL BASIC Controls 1

Controls These are the objects which can be pasted onto a form which display text, through picture boxes for graphic images, to buttons, check boxes, lists and other menus. Each control can have code attached to it. 2

ToolBox Tool Box contains the standard controls. You can add more controls by from components You can create your own controls ActiveX controls customised to specific purposes 3

Pointer Label control Frame control Check box Combo box Horizontal scroll bar Timer Control Directory list box Shape Object Image object OLE control Picture Box Text box Command Button Option Button List box Vertical scroll bar Drive list File list box Line object Data control 4

Visual Basic Controls Some of the common terminology associated with control Control as a object Property Method Event Procedure Program Statement Variable 5

Property With each object, various properties are associated which describe its characteristics. The properties can be set at design time by using property window or at run time through program statements Eg: Command1.Caption = Hello Few common properties are: Name, Caption, Appearance, Enable (True / False), Visible ( True / false) etc.. 6

Program Statement It is a keyword in the code that does the work of a program Eg: Unload formissue Call DISABLE ( Call procedure Disable) Form2.Show Setdb = OpenDatabase(C:inventory.mdb) Data1.UpdateRecord etc. 7

Variable It is a special container that holds data temporarily in a program Numbers, Charatcter strings, property values etc can be stored in variables Eg : Dim db As Database Dim strdiv As String Dim rs As Recordset Country = India etc. 8

Method It is a special statement that performs an action or a service for a particular object in a program Syntax : Object.Method Value Eg : List1.AddItem Printer ShowOpen SowPrint etc. 9

Form Events Whenever an event is triggered ( click, drag, resize, double click, key press etc.) a message is generated that describes your action.this message is sent to appropriate control, which in turn generates appropriate action based on pre-defined method. The event message can be customised the way action needs to be taken by writing your own code 10

Event Procedure It is a block of code that is executed when an object is manipulated in a program. Eg: When an event takes place, block of program code associated with it gets executed. Few common events are : Click, Dbclick, MouseDown, MouseUp, MouseMove etc. 11

Form Methods It is a command that allows you to tell an object what to do eg: Show hide, Unload, Print An example of programming construct: If Lable1.Caption = xxx Then hide form1 Object Property Assigned VB method Object name name Operator Function 12

Nomenclature convention of the objects For forms ( three nomenclatures are associated with it) 1. Name of the object form 2. Name of the caption of the form 3 Form file name for saving it as a part of project To avoid any confusion later, one should follow a convention of nomenclature, and should strictly follow throughout the project It is suggested to follow a convention:illustrated as follows 1 name the form object as -> frmsample 2. Name of the caption as -> Sample 3. Name of the file for saving it: -> Sample. 13

Nomenclature convention of For other objects the objects It is suggested to follow a convention:illustrated as follows 1 Name of an object frmsample, txtname, mnumain, cmdok, cmdadditem, datcourses etc. 2. Caption of the object The way, you want it to appear on the screen etc.. 14

Pointer The pointer is used for selecting objects which is to placed on the form. 15

Picture box A Picture box holds pictures created with the paintbrush or similar art packages. These must be in acceptable format like.bmp,.wmf,.ico etc..bmp Bitmap.WMF Windows MetaFile.ICO Icons.GIF Graphic Interchange Format.JPG Joint Photographic Expert Group. DIB Device Independent Bitmap.EMF Enhanced MetaFile 16

Image Control Image control is designed specifically for displaying images and not for creating new images or manipulating 17

Labels and Text Boxes Labels and Text boxes both holds text, but only Text Box is capable of receiving input from the user. Command Button Command buttons are one method of selection. They are typically used Where there are limited number of options - the choice may be be OK or Cancel, Start or Quit. 18

USE OF TEXTBOX & COMMAND BUTTON 1. Click the textbox control in the toolbox. 2. Move the mouse pointer to the form. Draw the Textbox of your need. 3. Click the command button control to the form 4. Draw the command button of any size. 5. Use the Properties set window & set the Properties as Control Property Setting Text1 Text (empty) Command1 Caption OK 6. Double click the OK command button. Type the following Text1.Text = Starting of Visual Basic 7. Now Run the program 19

Frame Control A Frame simply holds things together. If you place a set of controls with in a frame, they are all moved together as the frame is moved. Note:- that once a control has been placed in a frame, it cannot be moved out onto the form, and vice versa. 20

Check Boxes Check boxes act as toggle switches, turning options on or off. 21

Option buttons Option buttons are normally used to select one from a set of mutually exclusive options. At any one time there can be only one set on a form, unless they are enclosed in a frame. 22

List box List boxes display list of items, so that user can see what is available and select one. If the list is too long to fit in box, vertical scroll bar will be added at run time. Items can only be added to the list at the run- time, not at design time. 23

Use of List Box 1. Drag the List Box on the Form 2. Double Click the List Box and type the following Private Sub Form_Load() List1.AddItem "White" List1.AddItem "Black" List1.AddItem "Yellow" List1.AddItem "Green" List1.AddItem "Red" End Sub 3. Run 24

Combo box A Combo box combine a dropdown list with a slot in which user can enter their own data when the program is running 25

Use of Combo box 1. Drag the List Box on the Form 2. Double Click the List Box and type the following Private Sub Form_Load() Combo1.AddItem "one" Combo1.AddItem "two" Combo1.AddItem "three" Combo1.AddItem "four" Combo1.AddItem "five" Combo1.AddItem "six End Sub 3. Run 26

Horizontal and Vertical scroll bars The Horizontal and Vertical scroll bars are used on forms to give a very flexible means of setting values. When the Program is running, the position of the slider determines the value returned by the scroll bar. 27

Timer The Timer is unusual in that it is to be fixed size and is invisible once the program is running. Its purpose is to control actions the must take place at or after set intervals. EXAMPLE 28

Private Sub Command1_Click() If Text1.Text = "secret" Then Timer1.Enabled = False MsgBox ("Welcome To the System") Else MsgBox ("Sorry, Friend, I don't know you.") End If End Sub Private Sub Timer1_Timer() MsgBox ("Sorry, Your time is up.") End End Sub 29

Drive List box, Directory List box and File List box The Drive List box,directory List box and File List box can be used together to give the standard Windows file management facilities. When the program runs they will initially display the current drive and directory. These can be changed by clicking and highlighting in the usual way. Three boxes together can produce a highly efficient file selection routine. 30

USE OF DRIVELISTBOX, DIRECTORY LISTBOX, FILE LISTBOX & IMAGE CONTROLS 1. Click thedrivelistbox in the toolbox. 2. Move the mouse pointer to the upper-left corner of the form and then draw a drivelistbox. 3. Similarly draw the Directorylistbox and filelistbox. 4. Add the image box control to the right side of your form. 5. Double click the drivelistbox and type the following Dire1.Path = Drive1.Drive Close the Code window 6. Double click the directorylistbox and type the following File1.Path = Dir1.Path Close the Code window 7. Double click the Filelistbox and add the following code to the File1_Click event procdure. SelectFile = File1.Path & \ & File1.filename Image1.Picture = LoadPicture(SelectedFile) 8. Now Run the program. 31

The Shapes (either a circle, oval, square or rectangle) and Line are purely for decorative purpose 32

Data Control The Data control allows you to read records in from a database 33

OLE OLE stands for Object Linking and Embedding. This control allows you to make a two way link with an object in another Windows application. 34