Programming with visual Basic:

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

The Control Properties

2Practicals Visual Basic 6.0

Understanding the MsgBox command in Visual Basic

NATIONAL DIPLOMA IN COMPUTER TECHNOLOGY

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

Visual Basic. The Integrated Development Environment. Menu Bar

Visual Basic 6 Lecture 7. The List Box:

Programming Concepts and Skills. Arrays continued and Functions

Excel & Visual Basic for Applications (VBA)

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

variables programming statements

Control Properties. Example: Program to change background color

MICROSOFT EXCEL 2000 LEVEL 5 VBA PROGRAMMING INTRODUCTION

VBA. VBA at a glance. Lecture 61

6/14/2010. VBA program units: Subroutines and Functions. Functions: Examples: Examples:

IFA/QFN VBA Tutorial Notes prepared by Keith Wong

SYLLABUS B.Com (Computer) VI SEM Subject Visual Basic Unit I

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

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

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

Lab Manual Visual Basic 6.0

GUJARAT TECHNOLOGICAL UNIVERSITY DIPLOMA IN INFORMATION TECHNOLOGY Semester: 4

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

CS130/230 Lecture 12 Advanced Forms and Visual Basic for Applications

VISUAL BASIC For Engineers & Scientists. Shahab D. Mohaghegh, Ph.D. Professor Petroleum & Natural Gas Engineering West Virginia University

Visual Basic 1

Computer Science 110. NOTES: module 8

C:\MasterPageWeb\HAPR\docu\HAPR_VB6_version15sept06.rtf 19/10/08. HARP_VB projet en VB6

Visual Basic.NET. 1. Which language is not a true object-oriented programming language?

Visual Basic Tutorial (Lesson 2)

University of Technology Laser & Optoelectronics Engineering Department Visual basic Lab.

Type Storage Range of Values

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

MICROSOFT EXCEL VISUAL BASIC FOR APPLICATIONS INTERMEDIATE

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

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

Chapter 1. Block Diagram. Text .. 1

Visual Basic ,

Excel VBA Programming

Excel Macro Record and VBA Editor. Presented by Wayne Wilmeth

ENGG1811 Computing for Engineers Week 9 Dialogues and Forms Numerical Integration

VISUAL BASIC 6.0 OVERVIEW

HELP - VB TIPS. ANIMATE AN IMAGE BOX Insert a module. In this module, create a global variable: Global x

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

Visual C# Program: Simple Game 3

Document Editor Basics

Philadelphia University Faculty of Information Technology. Visual Programming

Creating Macros David Giusto, Technical Services Specialist, Synergy Resources

( ) 1.,, Visual Basic,

Overview About KBasic

I

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

Visual Basic ,

Unit 11.Introduction to Form and Report

M.C.A. (Sem.-II) Examination. Ma~' CCA-2003 : Building Client Server Application Using VB. Faculty Code: 003 Subject Code:

VBScript: Math Functions

Chapter 2.4: Common facilities of procedural languages

Universitas Sumatera Utara

3 IN THIS CHAPTER. Understanding Program Variables

Dive Into Visual C# 2008 Express

Microsoft Dynamics GP Modifier User s Guide

GUI Design and Event- Driven Programming

You will have mastered the material in this chapter when you can:

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

ADVANCED ALGORITHMS TABLE OF CONTENTS

EMPLOYEE PAYROLL SYSTEM

Contents. More Controls 51. Visual Basic 1. Introduction to. xiii. Modify the Project 30. Print the Project Documentation 35

Creating a Text Frame. Create a Table and Type Text. Pointer Tool Text Tool Table Tool Word Art Tool

Before We Begin. Introduction to Computer Use II. Overview (1): Winter 2006 (Section M) CSE 1530 Winter Bill Kapralos.

Loops! Loops! Loops! Lecture 5 COP 3014 Fall September 25, 2017

NiceForm User Guide. English Edition. Rev Euro Plus d.o.o. & Niceware International LLC All rights reserved.

COPYRIGHTED MATERIAL. Visual Basic: The Language. Part 1

IS 320 Spring 96 Page 1 Exam 1. Please use your own paper to answer the following questions. Point values are shown in parentheses.

FIT 100. Lab 8: Writing and Running Your First Visual Basic Program Spring 2002

DATABASE AUTOMATION USING VBA (ADVANCED MICROSOFT ACCESS, X405.6)

Lookup Project. frmlookup (Name: object is a combo box, style 2); use 4 labels: 2 for phone, 2 for mail. MsgBox Function:

Simplified Operating Instructions T105-C / T108-C / T106-C / T17B-C DISPLAYS DAY OR DAY BLOCK PROG 00:0000 PROG PROG ALWAYS OFF

Department of Computer and Mathematical Sciences. Lab 7: Selection

LESSON A. The Splash Screen Application

Selection Statements. Chapter 4. Copyright 2013 Elsevier Inc. All rights reserved 1

LAMPIRAN. Universitas Sumatera Utara

End User Guide. 2.1 Getting Started Toolbar Right-click Contextual Menu Navigation Panels... 2

2-26 Learn Visual Basic 6.0

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

Armstrong State University Engineering Studies MATLAB Marina Switch-Case Statements Primer

PROGRAM 1: SIMPLE CALCULATOR

Create a new document: Save your document regularly! The Big Picture: File>New

KODAK Software User s Guide. Software Version 9.0

MgtOp 470 Business Modeling with Spreadsheets Sample Midterm Exam. 1. Spreadsheets are known as the of business analysis.

KODAK Software User s Guide

UNIT 3 ADDITIONAL CONTROLS AND MENUS OF WINDOWS

1. Create your First VB.Net Program Hello World

Using Visual Basic Studio 2008

Full file at Programming in Visual Basic 2010

Visual Basic Visual Basic

Tutorials. Lesson 3 Work with Text

ACT! Calendar to Excel

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

END-TERM EXAMINATION

Transcription:

Programming with visual Basic: 1-Introdution to Visual Basics 2-Forms and Control tools. 3-Project explorer, properties and events. 4-make project, save it and its applications. 5- Files projects and exercises. 6- Dialogue boxes message boxes. 7-Basic elements for visual basic statements, Variables, assignment statements. 8-General view on assignment statement, constants and operations. 9-Adding astringe of variable. 10-Control statements and If then statements. 11-If-hen-els statement. 12-Select statement. 13-For-next statement. 14-Condition loop. 15-Nested-loop. 16-Seguences.

Microsoft Visual Basic 6.0

Basic Beginning All purpose Symbolic Instruction Code Windows VB Dos graphical VB user interface Properties Events VB Objects Actions Start>Programs>Microsoft Visual Studio 6.0>Microsoft Visual Basic 6.0 VB

a b c f d e Menu bar g a Toolbox Controls Toolbar c b Pointer Picture box (Label) Text Box Frame Command Button Check Box Option Button

Drop- Combo Box Down list List Box Horizontal Scrollbar Vertical Scrollbar Timer Drive List Box Dir List Box File List Box Shape Line Image Data OLE Form Window Stretch d object Properties Window Project Explorer Window e Form Layout Window f Private sub Code Code Window g

End sub VB objects toolbox design

Project1-Microsoft Visual Basic (design) object Code Project1-Form1 (Code) Start End Form Run Run Run Save Save File as File Save Project save save Project as VB Label

caption backcolor forecolor "اصنل"= Labelno.caption (رمق) QBcolor = Labelno.backcolor (رمق) QBcolor = Labelno.forecolor Fontsize (رمق)= Labelno.fontsize رمق = Labelno.fontsize or Label1 label caption label size Font

Text box control Text backcolor forecolor "اصنل"= textno.text (رمق) QBcolor = textno.backcolor (رمق) QBcolor = textno.forecolor Multiline Multiline True Enabled text Multiline False اعفل textno.enabled=true ریغ اعفل textno.enabled=false text delete welcome to visual basic world text1 text form textbox welcome to visual basic world true false text1 multiline Command Button

caption Style backcolor "اصنل"= commandno.caption 1-Graphical 0-Standard (رمق) QBcolor = commandno.backcolor style 1-Graphical name label form label Label Comma label1 caption form label caption form command button name command1 Private Sub Command1_Click() Label1.Caption = "Ahmad" command1 form Calculator

form VB Form object form name "الامس اولطملب"= formno.caption caption (رمق) formno.backcolor=qbcolor backcolor يمام( 0-15 ) (رمق) formno.forecolor=qbcolor forecolor (0-15) Shape shape backstyle backcolor bordercolor 0-rectangle 1-square 2-oval 3-circle 0-trancsparence 1-opaque shape1 shape shape1 shape 3- circle

caption label1 circle label1 Sha Lab :design stage List box Listno list show label form VB form hide hide show display form2 Form1 Label1: caption=" " Command1: caption="show"

Command2: caption="hide" Label1 Command1 Command2 form2 Option Button Caption, Font, Enabled, BackColor and visible click Command Button red, blue, green form option1:caption green option2: caption blue option3: caption red green option2 option1 caption

qbcolor vb Private Sub Option1_Click() Form1.BackColor = vbgreen Private Sub Option2_Click() Form1.BackColor = vbblue Private Sub Option3_Click() Form1.BackColor = vbred Check Box Caption, Font, Enabled, BackColor, Forecolor, value and visible Text Box Text1 Text Check1 caption Bold Check2 caption Italic Check3 caption underline Text1 Check1 Check2 Check3 text Private Sub Check1_Click() Text1.FontBold = Check1.Value Private Sub Check2_Click() Text1.FontItalic = Check2.Value Private Sub Check3_Click() Text1.FontUnderline = Check3.Value

Timer Interval enabled true/false interval timer timer1 interval timer caption label 1000 label1 Label Timer Private Sub Timer1_Timer() Label1.Caption = Time label1 time Message Box Input-Output Boxes Input Box Msgbox Msgbox "Message", Symbol, "title" Message box Msgbox

vbcritical 16 vbquestion 32 vbexclamation 48 vbinformation 64 Commands Commands Vbokonly 0 Ok Vbokcancel 1 Ok, Cancel vbabortretryignor 2 Abort, Retry, Ignore vbyesnocancel 3 Yes, No, Cancel vbyesno 4 Yes, No vbretrycancel 5 Retry, Cancel MsgBox "please close your program", 16, "Error" or MsgBox "please close your program", vbcritical, "Error"

Input Box Message Box X = Inputbox ("prompt","title") ok Prompt caption Title X inputbox x form Private Sub Form_Load() X=Inputbox("enter value of x", "calculation") enter value of x calculation x

Variables) Dim As true or false Integer Long Single Double String Boolean Date Time Constant Const = π. Const π.

assignment statement Variable name = expression Operation ) Operation Code) Mod AND, OR 3(x+4y) 3*(x+4*y) 2 X 4/2 X^2 4 / 2 : Val ( ) :Cstr( ) CInt ( )

Input textbox inputbox output textbox label message box print form caption form Command1 caption + Command2 Caption - Label1 Caption Caption text Label2 text1, text2 Dim x, y, z as integer Private sub command1_click () X=val(text1.text) Y=val(text2.text) Z=x + y Msgbox(" ="&z) End sub Private sub command2_click () X=val(text1.text) Y=val(text2.text) Z=x - y Msgbox(" ="&z) End sub

,"2007","100$","name" (string ) Dim As String Length Len ) Form1 Caption String length Command1 caption Click here Label1 Caption Length= Text1 Text Dim s As String Private Sub Command1_Click() s = InputBox("inter string") L = Len(s) Text1.Text = CStr(L) End sub abs(x) sqr(x) sin(x), cos(x) tan(x) x sin,cos,tan

print command1 text1, text2, text3 print run caption Dim a, b, c, av As single Private sub command1_click () a=val (text1.text) b=val(text2.text) c =val(text3.text) av=(a+b+c) / 3 Print "av=";av End sub input box label1, label2 run

conditional statements if statement select case if statement <, >, <=, >=, < >, =, and, or if if If..Then If condition then statement pass Dim x as integer Private sub command1_click() X= cint(text1.text) If x>= 50 then text2.text= "pass" End sub If block If condition then End if

pass Dim x as integer Private sub command1_click() X= cint(text1.text) If x>= 50 then text2.text= "pass" text2.fontsize=18 end if End sub If.. Then.. Else If condition then Else End if Dim x As Integer Private Sub command1_click() x = CInt(Text1.Text) If x >= 50 Then Text2.Text = "pass" Else Text2.Text = "fail" End If If.. then.. Elseif..Else If condition then Elseif condition then

Else End if Dim x As String Private Sub command1_click() x = text1.text If x = "Muhammad" Then MsgBox "hello, Muhammad" ElseIf x = "hasan" Then MsgBox "hello,hasan" Else MsgBox "hello, guest" End If If condition then If condition then Else Elseif Else End if option button nested if illegal division operation If Dim a, b, c As Single Private Sub command1_click() a = Val(Text1(0).Text) b = Val(Text2.Text) If Option1.Value Then c=a*b Text3.Text = CStr(c) Else

If b <> 0 Then Text3.Text = CStr(c) Else Text3.Text = "illegal division operation" End If End If Select Statement Select case variables Case value1 Case value2... Case else End select form Dim x As Integer Private Sub Command1_Click() x = CInt(Text1.Text) Select Case x Case 1 MsgBox ("Sunday") Case 2 MsgBox ("Monday") Case 3 MsgBox ("Tuesday")

Case 4 MsgBox ("Thursday") Case 5 MsgBox ("Wednesday") Case 6 MsgBox ("Friday") Case 7 MsgBox ("Saturday") End Select loop statement visual basic counter loop for next For variable = start value to end value step step value Next variable Dim i as integer Private Sub Command1_Click () For i = 1 To 5 Print "hello" Next i hello Conditional Loop Do while Do until Do while Do Do Do while Do while Loop

Do while condition Loop do while Dim i as integer Private Sub Command1_Click () i=1 Do while i <= 5 Print "hello"; i i=i+1 Loop hello Do until Do until Loop Do until condition Loop Dim i as integer Private Sub Command1_Click () i=1 Do Print "hello"; i i=i+1 Loop until i > 5 hello Exit Exit for Exit Do For next Do while

s=1+x+x 2 +x 3 + +x n x Dim I, n, sum as integer Dim x,s as Double Private Sub command1_click () sum = 1 n=cint(text1.text) x=val(text2.text) For i = 1 To n Sum = sum +x^i Next i Text3.text=cstr(sum) nested for For i = 1 To n For j = 1 To m Next j Next i Dim I, j As Integer Private Sub command1_click() For I = 1 To 10 For j = 1 To 10 p=i*j Print I; "*"; j; "="; p, Next j Print Next I

label y x x x y=-x Y=x check box option button 9-10 A 7-8 B 5-6 C 0-4 D