Instructor :Prof.Dr.Erden Başar (Office : 212)
Assistant : Yiltan Bitirim(office :111), Mehtap Kose (office :106)
Term : 1999 Spring
Course hours
Wednesday 08:30 – 10:20
Friday 12:30 – 14:
Tuesday 10:30 - 12:20 Laboratory (Only used for the given Assignment and home works)
Office hours
Friday 15:00- 17:00
Exams
1 Midterm Design and program writing
1 Final Assignments are important
Assignments
Three assignments will be given for duration of two or three weeks
Course evaluation Midterm Assignments Final
% 30 % 30 % 40
Note : Assignment will be accepted if Average of midterm exam and final exam >= 50 OR Final exam grade >= 50.
Weekly Course Plan(First week)
Visual Programming
Why Visual Basic
History of Visual Basic
Internet sites of Visual Basic
Installing Visual Basic
Getting Assistance While You Work
Developing an Application in Vb
Visual Basic Concepts
Elements of Integrated Development Environment
First Vb Application
Visual Programming
-
Graphical User Interface(GUI=gooies). Have revolutionized the microcomputer Industry.
-
A Picture is worth a thousand words.
-
Disadvantages of DOS environment
-
Keyboard and Function keys
-
Function of mouse
-
GUI programs : If you need to develop programs for any version of windows, you’ll need a tool to develop GUI- based applications efficiently.
-
For a long time there were no such tools, before VB was introduced in 1991 as version 1.0, Developing Windows applications was much harder than developing DOS applications.
-
Programmers had to worry about too much, such as what the mouse was doing, where the user was inside a menu.
-
And whether she/he was clicking or double-clicking at a given place.
-
Developing a Windows application required expert C programmers and hundred of lines of code for a single task.
-
It was called “The perfect programming environment for the 1990’s “
Steward Alsop was quoted in the Newyork Times.
-
Up to release 4.0 VB was known as “event driven programming” with and used in Windows 3.x
-
Release 4.0 of VB comes at an extremely exciting time. Windows 95 and VB 4.0 are introduced together.
History of Visual Basic
VB was introduced in 1991 as Version 1.0.
-
Very simple controls(controls nuts and bolts of your project, we use controls to get user input and to display output)
-
Combo box controls and a few..
-
No DBMS features
-
Only sequential and random files
VB Version 2.0
Paradox(only level of module)
VB Version 3.0 -
More powerful dbms features
-
No need standard module of dbmn
-
OLE 1.0(Object linking and embedding ) feature.
VB Version 4.0 -
Ability to generate 32-bit applications for both windows95 & Windows NT.
-
Use OLE technology of Microsoft.
-
Use some of the techniques of OOP and class modules are introduced.
-
The ability to extend the VB programming environment. Create or use third party tools into the VB environment.
-
Conditional compilation to allow you to do multi platform development more easily.
VB Version 5.0
-
Compilation of native code, p-code.
-
Create it’s own Active-X controls
-
Multiple projects
-
Design and application for Internet and Intranet environment with Active-X document
-
New function of code editor.
-
Downloadable Internet controls.
-
Object base data storage- repository.
-
Has dynamic Linked Library(DDL), To combine VB with another programming languages such as C.
-
You could also create your own OLE controls in C and use them in VB
VB Version 6.0
Create applications, and both client and server-side components that are optimized for througput by the world-class Visual C++ 6.0 optimized native-code compiler
-
ADO(ActiveX Data Objects)
Visual Basic 6.0 introduces ADO as the powerful new standard for data access, Included OLE DB drivers include SQL server 6.5+, Oracle 7.3.3+, Microsoft Access, ODBC, and SNA server.
-
Integrated Professional Visual Database Tools
Visual Basic 6.0 provides a complete set of tools for integrating databases with any application.
-
Data environment designer
-
Visual Basic WebClass Designer
-
Dynamic HTML Page Designer
Internet sites of VB http://www.microsoft.com/vbasic http://www.vbstart.com http://www.apexsc.com http://www.parsec.com http://www.vbonline.com http://www.winsite.com http://ozemail.com.au http://kuai.se http://www.infinet.com http://website.ora.com http://pages.prodigy.com/MO/vbsite/ http://users.aol.com/yodamon/cafevb.htm
Helps in VB
Visual Basic Books Online http://www.microsoft.com/VBasicSupport/ Help, Microsoft on the Web
Installing Visual Basic 5.0
-
You install Vb on your computer using the setup Program in VB 5.0 CD-ROM.
-
The setup program installs
Visual Basic itself
The Help System
Sample Application
VB Online
Other product components
-
You can not simply copy files from CD-ROM to your hard disk and run VB.
-
Before you install VB, make sure that your computer meets the minimum requirements.
Hardware Requirements :
Windows95, windows NT 3.51 or later
80486 or higher processor
16 MB of RAM
A hard disk with a minimum of 50 MB for full instalation.
A CD-ROM
VGA or higher resolution.
Mouse
VB 5.0 has
Learning edition
Professional edition
Enterprise edition
Professional edition provides the following book.
Language reference
ActiveX Controls Reference
Programmer’s Guide
Getting Assistance While You Work
Visual Basic Books Online
VB Books Online contains all of the VB documentation in one location.
To start VB Books online
-
From the Help menu , select Books Online
VB Books online will be displayed
There are several ways you can look for information in Books online.
Presents a complete hierarchical list of the books and topics.
You can chose from an alphabetical list .
You can type a word or phrase, or select a previous search string from the top-down list.
Contents
Index
Find
Pressing F1 to get context-sensitive Help on the Visual Basic programming environment
Help contains Code examples that you can run from VB.
Developing an Application in Vb
VB is Windows development language, that’s why you must be familiar with the Windows environment. Windows involves three key concepts:
Windows
Events
Messages
Window :
A window is a simply rectangular region with its own boundaries.
Examples of windows are:
-
An Explorer window in windows 95
-
A document window in word processor
-
Dialog box that pop up window and reminds you of an appointment
The Microsoft Windows Operating system manages all of these many windows by assigning each one a unique id number. The system continually monitors each of these windows for signs of activity or events.
Events :
An event is an action recognized by a form or control. Events can occur through user action(response) such as a mouse click or a key press using objects of window(through programmatic control), or even as a result of another window’s action.
Event-driven applications execute Basic code in response to an event. Each form and control in VB has a predefined set of events. If one of these events occurs and there is a user code in the associated event procedure, VB invokes that code.
For example most object recognize a Click event-If a user clicks a form(object), code in the form’s Click event procedure is executed. If a user clicks a command button, code in the button’s click event procedure is executed.
Each time an event occurs, it causes a message to be sent to the O.S. The system processes the message and broadcasts it to the other windows. Each window can take the appropriate action based on its own instructions from dealing with that particular message.
Fortunately, VB insulates you from having to deal with all of the low-level message handling. Many of the messages are handled automatically by VB.
This allows you to quickly create powerful applications without having to deal with unnecessary details.
Understanding the Event-Driven Model
Programs in conventional(traditional or procedural) programming languages run from the top down. For older programming languages, execution starts from the first line and moves with the flow of the program to different parts as needed.
A VB program usually works completely different. The code doesn’t follow a predefined path. It executes different code section in response to events.
The core of a VB program is a set of independent pieces of code that are activated by , and so respond to, only the events they have been told to recognize.
The programming code in VB that tells your program how to respond to events (event procedure). An event procedure is a body of code that is only executed in response to an external event.
Your code can also trigger events during execution. It is for this reason that it is important to understand the event-driven model and keep it in mind when designing your application in windows environment.
Here is a summary of the steps you take to design a VB application:
-
Customize the windows that the user sees.
-
Decide what events the controls on the on the window should recognize.
-
Write the event procedures for those events.
Here is what happens when the application is running:
1. The application starts and a form is loaded and displayed
2. The form(or a control on the form) receives an event. The event might be caused by the user(for example , a keystroke), by the system(for example , a timer event), or indirectly by your code(for example, a Load event when your code loads a form)
3. If you have written an event procedure, VB executes the code.
4. The application waits for the next event.
Many events occur in conjunction with other events. For example, when the DblClick event occurs, the MouseDown, MouseUp, and Click events also occur.
Elements of the Integrated Development Environment(IDE)
The working environment of VB is a real IDE. It integrates many different functions such as design, editing, compiling, and debugging within a common environment.
Starting VB
After selecting Visual Basic from your program group you will have the following window from the monitor. IDE has the following elements
Title Bar
Title bar is the horizontal bar located at the top of the screen; It gives the name of the application(name of the project). Depends on the phase of project.
When you are designing the application
Project1-Microsoft Visual Basic[Design]
When you are running your program
Project1-Microsoft Visual Basic[Run]
For the debugging environment
Project1-Microsoft Visual Basic[break]
Menu Bar
Displays the commands you use to work with VB. These are
File Format Add-Ins
Edit Debug Window
View Run Help
Project Tools
Tool Bars
Provide quickly access to commonly used commands in the programming environment. You click a button on toolbar and it executes the necessary process.
Consist of the following icons.
Newform
NewModule
OpenProject
SaveProject
LockControl
MenuEditor
Properties
ObjectBrowser
Project
Start
Break
End
ToggleBreakPoint
InstantWatch
Cut
Paste
ToolBox
Provides a set of tools(controls) you use at design time. You can also add some other controls. The controls that are used in Visual Basic are the heart and soul of the programs that you create. The controls enable you to edit text, connect to a database, retrieve file information from a user, or display and edit pictures.
Project explorer Window
Another window on the desktop is the Project window. This window shows a list of all the forms and code modules that are used in your current project.
Properties Window
List the property settings for a selected form or control. It shows all the available properties for the currently selected for, control, or module. Properties determine how a form or control looks and how it behaves in a program. They can be changed during design or run time.
The Properties window has two tabs on it. These tabs enables you to group the properties either alphabetically or by logical categories.
It includes a description of the selected property in a pane at the bottom.
Share with your friends: |