VB Ide
VB Ide
VB Ide
Editions of VB 6.0
1. Learning Consists of all necessary tools required to build main stream Windows Applications 2. Professional Includes advanced features such as tools to develop ActiveX and Internet controls. 3. Enterprise In addition to all Professional features, it also includes tools such as Visual SourceSafe and the Automation and Component Manger.
Introduction to Visual Basic Comparison between Access and Visual Basic Features Form Designer Design Tools Add drawings to the forms Setting properties of the individual object on the form Building an Executable Debug the applications Examine the objects in the form Access Available Available Can be done Is possible Visual Basic Available with more advanced tools Available with much enhanced tools Can be done with more options Can be done in an easier manner and more properties available Utility for building executable is there with software This facility is available
Executable can be made with add-on utility Not present There is no option by which we can see all the objects at one place
Work with data in programs(ODBC) Add more functionality to the program by writing code Create crystal reports
Object Browser is there to see all the objects at one place along with there methods and procedure Is there Is there with more options for drivers Code can be written using Visual basic itself is used for Visual Basic which is altogether writing code is a different software Not available Is available as Add-on with Visual Basic
Advanced features
Integrate Visual database tools Visual Basic 6.0 provides a complete set of tools for integrating databases with any application. Database features include design tools for creating and modifying Microsoft SQL Server, Oracle 7.3.3 or above, and AS/400 databases.
DataEnvironment designer for data connectivity Visually create reusable recordset command objects with drag-and-drop functionality. Bind to multiple data sources for data aggregation and manipulation.
Drag and drop creation of data bound forms and reports Using the new Data Environment designer, developers can quickly drag-and-drop custom data-bound controls to create forms; they can create reports with the new Data Report Designer. Creation of custom data hierarchies is as easy as filling out a dialog box and dragging the command to the form.
Visual Basic Web class Designer Create server-side applications and components that are easily accessible from any Web browser on any platform.
Dynamic HTML Page Designer Develop multimedia-rich applications using the document object model and Dynamic HTML surface as the user interface.
New performance enhancements Use new String Functions and features such as "Retain in Memory" to create faster, more scalable applications and components.
The ActiveX Technology It is used to create Internet Enabled applications that are limited only by your imagination. Its come with several controls that allow you to create Web Based application .
Introduction to Visual Basic Forms Window This is where you design your form. A form is what you will present to a user of your application. A form could be an introduction screen, it could be a dialog box giving the user options, it could be a box containing a warning. All of your VB programs will revolve around a number of forms.
The Toolbar The toolbar provides quick access to commonly used commands. These will be explained later in the document. The Toolbox This floating window provides the tools for designing/creating an application on your form. They can create buttons, text boxes, labels, scroll bars and other commonly used windows items. The Property Window All items placed on a form have properties (explained in further detail later on) such as the colour of a button, what type of border a text box has or what font a label is displayed in. The Project Window A project is a complete application; this includes all the forms, programming code and other files needed to run this application.
Add Form
Adds a new form to your project. This button will also add a new: MDI Form (Where you can have multiple instances of the same form on the screen) Module (A module contains general programming code independent of specific forms and controls. It contains things like variable declarations, constants, and user-defined sub-programs. Modules can be used in more than one application) Class Module User Control Property Page User Document You can also add an ActiveX designer application to VB or add an existing form, module, or other file to the current project using the Add File... command.
Introduction to Visual Basic Menu Design Window Opens a window that lets you define your own menu systems for your applications. This is the same as going to the Tools menu and choosing the Menu Editor... command. Opens a previously saved application (applications are called Projects). This is the same as going to the File menu and choosing the Open Project command. Saves the current application/project. This is the same as going to the File menu and choosing the Save Project command. These are standard windows application buttons and work as in all Microsoft products. This is useful for finding keywords in code. Undoes the last action that you performed. It is not available if there is nothing to undo. Redos the last action that was undone. This will execute the current application (or resume a suspended one). It places you in Run mode. It is the same as going to the Run menu and choosing Start or Continue. This will pause the current application and will place you in Break mode. You can then test the program, using the debugging tools, to see if it is working correctly. You can also do this by going to the Run menu and choosing the Break command. To resume the application click on the Continue (the Start) button on the toolbar.
Open Project
Save Project
Find
Undo
Redo
Start
Break
Introduction to Visual Basic End This will end the current running application and return you to Design mode. You can also do this by going to the Run menu and choosing the End command. Displays the Project Window, which lists all of the files used in your application. This activates the Properties Window. You use the Properties window to assign attributes to items on a form. This is the same as going to the Window menu and choosing the Properties command. This shows the Form Layout Window, which lets you determine the starting position of your form relative to the screen. Brings up the Object Browser, which is used for finding out about objects, properties and methods (described later in this manual). This displays the Toolbox on the left of the screen. The Toolbox contains the objects that can be drawn on your form. This allows you to view all of the databases that you are connected to. You can see their tables, queries and other useful items. This will help advanced users to organise and sort their visual studio projects better.
Project Explorer
Properties Window
Object Browser
Toolbox
ActiveX Control Used to develop your own ActiveX controls. It is a basic element of the user interface . If the ActiveX control that comes with Visual Basic dont provide the required functionality then custom ActiveX controls can be build. ActiveX Document DLL, ActiveX Document EXE ActiveX documents are in essence Visual Basic applications that can run in the environment of a container that supports hyperlinking VB Application Wizard, VB Wizard Manager The Application Wizard takes through the steps of setting up the skeleton of a new application like a template in any MS-office component where basic structure is readily available and changes can be made depending on the need. Whereas VB Wizard Manager helps in building our own Wizard which is a sequence of windows that collects information from user required for building an application. Data Project This is a feature of enterprise edition that automatically adds the controls that are used in accessing databases to the Toolbox DHTML Application Allows to build Dynamic HTML pages that can be displayed in the browser's window on a client computer. It helps user in viewing the data lying with any RDBMS package at the backend and can also edit that and can do the queries also through browser itself. IIS Application Allows to build applications that run on the Web server and interact with clients over the Internet with Internet Information Server Add-In Own Add-Ins can be created for the Visual basic IDE. Add-Ins are special commands that can be added to Visual Basic menus VB Enterprise Edition Control It simply creates a new Standard EXE project and loads all the tools of the Enterprise Edition
2.
3. Write the events code In the code window, write the code associated with each object on the form and then run the application
Properties Window
View Code
Example 1: This example is to print a text in the text box by clicking on the button. With the help of Tool Box given on the left side of the interface, draw the following interface :
Set the properties of the objects on the form as given in the table below : Object Name Property Value Text Box Text1 Text <Blank> Command Button Command1 Caption Click here Command Button Command2 Caption Stop Double click First Command Button and write the following lines of code
Private Sub Command1_Click() Text1.Text = "Welcome to Visual Basic" End Sub
Click View Object to come back at the form Double click Second Command Button and write the following lines of code
Private Sub Command2_Click() End End Sub
Run the project by clicking Run>>Start or Press F5. Save the project by clicking File>>Save Project. Specify the folder in which all the files like form, reports etc. related with the project along with the project name are to be saved. Note : It is advised that one folder for each project should be created.
Example 2: This example is to calculate the simple interest to be paid on the given principle amount, rate of interest and the number of years. Create a new Standard EXE Project by clicking on File>>New Project and then following the steps given in example 1. Draw the inteface as given below using the same Tool Box.
Label4
Object Text1 Text2 Text3 Text4 Label1 Label2 Label3 Label4 Command1 Text Text Text Text Caption Caption Caption Caption Caption
Property
Value <Blank> <Blank> <Blank> <Blank> Principal Amount Rate of Interest Number of Years Interest to be paid Calculate
Run the Project and enter the values and then click the command button to see the result. Training Division, NIC, New Delhi B 14
Controls Reusable objects that provide the pieces of the visual interface of a
program. Examples of controls are a text box, a label, or a command button.
Event An action initiated by the user, the operating system, or the program itself. Examples of events are a keystroke, a mouse click, the expiration of a specified amount of time, or the receipt of data from a port. Methods Predefined actions that can be performed by an object. For example, a
form has a Hide method that makes it invisible to the user.
Procedures Segments of code that you write to accomplish a task. Procedures are often written to respond to a specific event. Types of procedures include Sub procedures, which consist of a sequence of statements; and Functions, which return a value. Properties The characteristics of an object, such as its size, position, color, or text font. Properties determine the appearance and sometimes the behavior of an object. Properties are also used to provide data to an object and to retrieve information from the object.