2Practicals Visual Basic 6.0

Similar documents
The Control Properties

Programming with visual Basic:

Visual Basic 6 Lecture 7. The List Box:

Relational Operators. > greater than < less than >= greater than or equal to <= less than or equal to <> not equal to = equal to

An InputBox( ) function will display an input Box window where the user can enter a value or a text. The format is

Angel International School - Manipay 1 st Term Examination November, 2015

Collaboration Tools. Student Guide. Copyright 2015 by Edmentum. All Rights Reserved.

Function: function procedures and sub procedures share the same characteristics, with

Angel International School - Manipay 1 st Term Examination November, 2015

Type Storage Range of Values

Visual Basic , ,. Caption Hello, On Off. * + +, -. 1-Arrow, , 2- Cross. - project1.vbp, 4-form1.frm.

Visual Basic ,

Layout Manager - Toolbar Reference Guide

17. Introduction to Visual Basic Programming

Control Properties. Example: Program to change background color

Visual Basic Tutorial (Lesson 2)

National Weather Map

END-TERM EXAMINATION

PROGRAM 1: SIMPLE CALCULATOR

Final Java Experiment List(For Internal and External)

VBA Collections A Group of Similar Objects that Share Common Properties, Methods and

Agenda. First Example 24/09/2009 INTRODUCTION TO VBA PROGRAMMING. First Example. The world s simplest calculator...

Site Manager. To edit a page already in place, click on the name of the page.

Minimize Restore Close. Top Level Tabs. Quick Access Toolbar. Title Bar. Ribbon. Group. Rulers. Status Bar View Buttons.

SPARK. User Manual Ver ITLAQ Technologies

Step-by. A Very Warm Welcome to the Exciting World of Computers. Let s get Started It s easy with my Step- Instructions

Strands & Standards WORD PROCESSING

Microsoft Excel 2016 Level 1

KODAK Software User s Guide

Word Processing. EXAM INFORMATION Items. Points. Prerequisites. Grade Level. Course Length. Career Cluster EXAM BLUEPRINT. Performance Standards

KODAK Software User s Guide. Software Version 9.0

A Complete Tutorial for Beginners LIEW VOON KIONG

Reprinted with permission, Pat Weddle, Alice Buffett Middle School, Omaha Public Schools.

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

Start Visual Basic. Session 1. The User Interface Form (I/II) The Visual Basic Programming Environment. The Tool Box (I/II)


UNIT 3 ADDITIONAL CONTROLS AND MENUS OF WINDOWS

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

DATA 301 Introduction to Data Analytics Microsoft Excel VBA. Dr. Ramon Lawrence University of British Columbia Okanagan

Left aligned tab: Numbers and text is aligned to the left edge of the tab.

Introduction to Qualtrics

NATIONAL DIPLOMA IN COMPUTER TECHNOLOGY

VBScript: Math Functions

INTRODUCTION TO COMPUTER CONCEPTS CSIT 100 LAB: MICROSOFT POWERPOINT (Part 2)

Information Technology Practicals related General Instructions

Concordance Basics. Part I

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

Visual Basic. The Integrated Development Environment. Menu Bar

Visual Programming 1. What is Visual Basic? 2. What are different Editions available in VB? 3. List the various features of VB

Tech-Talk Using the PATROL Agent COM Server August 1999 Authored By: Eric Anderson

Annotate PDFs. GUIDE v.1.1. IT Services. User Services

CENTAUR S REAL-TIME GRAPHIC INTERFACE V4.0 OPERATOR S MANUAL

SAULT COLLEGE OF APPLIED ARTS & TECHNOLOGY SAULT STE MARIE, ON COURSE OUTLINE

Microsoft PowerPoint 2010

Download the files from you will use these files to finish the following exercises.

The following instructions cover how to edit an existing report in IBM Cognos Analytics.

Problem description: After finishing the lab, the student will practice:

Accelerated Technology Training Workshops. Using Microsoft FrontPage to Create Web Sites ENGL 1423.B2 Dr. Richard Cunningham

CMPT 110 MIDTERM OCTOBER 18, 2001

Visual Basic 1

streamed Video On-Demand

UNIT 1. Introduction to Microsoft.NET framework and Basics of VB.Net

How to Set Up WebEx Settings Before a Meeting

CPSC 203 Extra review and solutions

EDIT202 PowerPoint Lab Assignment Guidelines

AGENDA. :: Homework Upload. :: Photoshop Lesson 4: Creating a PSD Wireframe [Homepage] I. DOCUMENT SET-UP: II. DRAWING SHAPES III.

Visual Basic ,

Band Editor User Guide Version 1.3 Last Updated 9/19/07

:: MULTIMEDIA TOOLS :: CLASS NOTES

StandardWriter Software Create great rubrics and product guides in a flash. The Curriculum Project PMB Bee Cave Rd.; #650 Austin, TX 78746

Create & Use Your Own Teaching Website BJORN CANDEL FUJAIRAH MEN S COLLEGE

Level 6 Relational Database Unit 3 Relational Database Development Environment National Council for Vocational Awards C30147 RELATIONAL DATABASE

Desktop Publishing. MIT Computer Centre 5/1. Shortcut Key of UNDO is A) Ctrl + X B) Ctrl + H C) Ctrl + Y D) Ctrl + Z Correct Answer : D

Guide to WB Annotations

Experiment No. 2. Program:

Laboratory 1. Part 1: Introduction to Spreadsheets

Human Factors Engineering Short Course Topic: A Simple Numeric Entry Keypad

Website Pros Database Component. v

Getting started 7. Writing macros 23

Contents Introduction Getting Started Visual Basic Form Configuration Entering the VB Code

Creating Booklets Using Microsoft Word 2013 on a PC

Las Vegas, Nevada, December 3 6, Kevin Vandecar. Speaker Name:

Goldfish 4. Quick Start Tutorial

Fall 2016 Exam Review 3 Module Test

INFORMATION TECHNOLOGY

Microsoft Office Training Skills 2010

Getting started 7. Setting properties 23

Sample Paper 2010 Class XII Subject Informatic Practices

Instructions for Using PDF Tests and Journals

Using PowerPoint to Create ebooks

Microsoft Word XP (2002)

<excelunusual.com> Easy Zoom -Chart axis Scaling Using VBA - by George Lungu. < 1. Introduction: Chart naming: by George Lungu

PROGRAMMING LANGUAGE 2 (SPM3112) NOOR AZEAN ATAN MULTIMEDIA EDUCATIONAL DEPARTMENT UNIVERSITI TEKNOLOGI MALAYSIA

GIMP ANIMATION EFFECTS

Design Of Human Computer Interfaces Assignment 1- Hello World. Compliance Report

POWERPOINT 2003 OVERVIEW DISCLAIMER:

Macromedia RoboHelp Course Outline

Unit 11.Introduction to Form and Report

Building an Interactive Web Page with DataSocket

Drawing an Integrated Circuit Chip

Transcription:

2Practicals Visual Basic 6.0 Practical 1: 1. Navigation of Visual Basic Integrated Development Environment The Visual Basic IDE is made up of a number of components Menu Bar Tool Bar Project Explorer Properties window Form Layout Window Toolbox Form Designer Object Browser Code Window First of all, you have to launch Microsoft Visual Basic 6.In the Visual Basic 6 integrated development environment, a default form with the name Form1 will be available for you to work on your new project. Now, double click on Form1, the source code window for Form1 as shown in figure will appear. The top of the source code window consists of a list of objects and their associated events or procedures. In figure, the object displayed is Form and the associated procedure is Load. Vbforswedish.blogspot.com Page 1

Practical 2: Controls And Properties(1): Visual Basic Controls and Properties provide a simple means to quickly create rich interfaces for your Visual Basic applications. Controls on toolbar are shown in the picture: Properties can be set by highlighting the items in the right column then change them by typing or selecting the options available. Program to change shape This code will change the shape to a circle at runtime. Private Sub Form_Load() Shape1.Shape = 3 Vbforswedish.blogspot.com Page 2

Practical 3: empty. Controls And Properties(2): To calculate and to display the output on the label The two text boxes are used to accept inputs from the user and one of the labels will be used to display the sum of two numbers that are entered into the two text boxes. Besides, a command button is also programmed to calculate the sum of the two numbers using the plus operator. Draw Graphical User Interface 1. Insert two text boxes along with three labels and a command button. 2. As given in the figure. Attach Code 1. Double Click The command button, code window will appear. 2. Then write the following code in the code window. 3. Now run the program. Dim x As Integer, y As Integer x = Text1.Text y = Text2.Text Label3.Caption = Label3.Caption & x + y 4. An example output is given in the figure. Update Properties 1. Change label1.caption as Number1, label2.caption as Number2 and label3. Caption as Sum= 2. Change text1.text and text2.text to Vbforswedish.blogspot.com Page 3

Attach Code Double Click The command Practical 4: Creation of Label, Button and text Boxes: Label: It represents a standard Windows label. It is generally used to display some informative text on the GUI which is not changed during runtime. Textbox: It is used to take it input or display output to the user. Command Button: It is generally used to generate a Click event by providing a handler for the Click event. Print "Welcome " & Text1.Text button, code window will appear. Then write the following code in the code window. Now run the program. An example output is given in the 1.Put a label as label1, a text box as text1 to take input and a command button as command1 Update label1 caption Type your name? go to properties window select Font option, make style BOLD and size 14. Make text1.text = Change the caption of command1 to CLICK Figure 1 Practical 4 Vbforswedish.blogspot.com Page 4

Practical 5: Program that will show you a message "Welcome you are campus 3 student if your roll number satisfies the rule. 3. Place a label on the form. Dim x As Long Dim y As Long x = InputBox("Enter your Roll#?", "Campus Check") y = x \ 1000000 If y = 3 Then MsgBox "Welcome you are campus 3 student" 1. Update label1 caption as Click button 2. Set caption of the button to Press. End If 1. Double Click button. 2. Write the following code in the click 3. Run the program. Vbforswedish.blogspot.com Page 5

Practical _6: Program that will input a number from user and will display weather it is positive, negative or zero? 3. Place a label on the form. 4. Place a text box on the form. 1. Update label1.caption as Enter a number to check? 2. Set button caption to check Nain Markaz-e-Taleem 1. Double Click button. 2. Write the following code in the click 3. Run the program Dim x As Integer x = Text1.Text If x > 0 Then MsgBox "Positive" ElseIf x < 0 Then MsgBox "Negative" Else MsgBox "Zero" End If Vbforswedish.blogspot.com Page 6

Practical _7: Write a program that will take your marks out of hundred and calculate your grade? 3. Place a label on the form. 4. Place a text box on the form. 1. Update label1.caption as Enter your marks to check your grade? 2. Set button caption to Grade 1. Double Click button. 2. Write the following code in the click Nain Markaz-e-Taleem Dim marks As Integer marks = Val(Text1.Text) Select Case marks Case Is > 80 MsgBox "Grade A" Case Is > 60 MsgBox "Grade B" Case Is > 40 MsgBox "Grade C" Case Else MsgBox "Fail" End Select Figure 2 Practical _7 Vbforswedish.blogspot.com Page 7

Practical 8: Write a program that will calculate the factorial of given number using while loop? 3. Place a label on the form. 4. Place a text box on the form. Nain Markaz-e-Taleem 1. Update label1.caption as Enter a number to get factorial? 2. Set button caption to factorial 3. Set text1.text= Figure 3 Practical 8 1. Double Click button. 2. Write the following code in the click Dim n As Integer, i As Integer, fact As Integer n = Text1.Text fact = 1 i = 1 While i <= n fact = fact * i i = i + 1 Wend MsgBox "Factorial" & fact Vbforswedish.blogspot.com Page 8

Practical 9: Write a program that displays first five odd numbers using FOR Next loop? 4. Set button caption to Show Odd 3. Double Click button. 4. Write the following code in the click Nain Markaz-e-Taleem Dim number as integer Print First Five ODD numbers: For number=1 to 10 step 2 Print number Next Figure 4 Practical9 Vbforswedish.blogspot.com Page 9

Practical 10: Add menus in an application. Change Background colors through menu options? Draw GUI and update properties: 2. Press CTRL+E or select Menu Editor from TOOLS menu to start a menu editor. 3. Enter Colors in caption and mnucolor in Name. The name of the menu will appear in lower box of menu editor. 4. Click next to add another menu. 5. Enter RED in caption field and mnured in name field and then do the same for Green and Yellow. 6. set shrot cut Ctrl+r for red, Ctrl+g for green and Ctrl+y for yellow. 5. Click the menu Colors->Red button. 6. Write the following code in the click Nain Markaz-e-Taleem Private Sub mnugreen_click() Form1.BackColor = vbgreen Private Sub mnured_click() Form1.BackColor = vbred Private Sub mnuyellow_click() Form1.BackColor = vbyellow Vbforswedish.blogspot.com Page 10

Practical 11: Write a program that will take your year of birth and return your age in years using function procedure? 3. Place a label on the form. 4. Place a text box on the form. 1. Set button caption to Age. 2. Set the caption of albel1 to Enter your Date of birth? 3. Set text1.text=. 4. Set format of text1.text to DATE. 1. Double Click button. 2. Write the following code in the click Dim birth As Date Dim yr As Integer birth = Text1.Text yr = age(birth) MsgBox "Your age is= " & yr Private Function age(b As Date) As Integer Dim cd As Date cd = Date age = DateDiff("yyyy", b, cd) End Function Vbforswedish.blogspot.com Page 11