Visual basic programming pdf ebook download


















Provide clues where required without making an overkill. Usability :- The user must be able to use your application with ease. The user is also concerned with the help ,hints and guidance he can get from the applications itself. Images :- A picture is worth a thousand words. Your understanding of the theme will depend upon your frame of mind at the time.

That is the problem of using images or icons to convey a message. Use only those pictures and icons in your program that are universally understood and accepted. What you understand may not be what the user does. Colors :- Use Simple colors. The user is going to be looking at the form that you have designed. Do not have too many colors on your form.

When viewed on a color display, some of the colors may disappear. Compile Time Errors 2. Runtime Errors 3. Logic Errors 1. Compile Time Errors: These Errors occurs while writing the code. They usually occur when the syntax of any visual basic statement is invalid. These Errors are easy to locate and correct.

VB checks the syntax of each line of code as you enter and informs you by means of highlighted text. They do not occur until you run your application. Logic Errors: Logical Errors occur when your application produces in correct results. These errors normally occur due to a mistake made by the programmers. Error Description Syntax Error Occurs when we enter an incorrect line of code such as a mistake in typing a keyword, a punctuation is missing or an incorrectly spelled variable. For example, using an If statement without a matching End If results in a syntax error.

Visual Basic notifies us of the syntax errors before we leave a line of code. Run-time Error Occurs when a command attempts to perform an action that is not valid. For example, a run-time error occurs if we try to assign a string to a numeric variable. Error handlers execute only if a run-time error is encountered.

Logic Errors Occurs when an application executes without syntax errors or run-time errors, but the results are not what we intend. For example, an application might prompt the user for a password but then may not allow access to the application even if the password is correct.

This might be acceptable during development and testing phases. So, your code should trap and deal with its own errors. This statement waits for an error to occur and when the error occurs the error trap statement performs an action written under error handler. On error statement has three forms. On Error Goto Label 2. On Error Resumenext 3. On Error Goto 1. On Error Goto Label : using this statement in your code, makes VB application to jump to a specific location in your code, if an Error occurs.

Errors handle code is always written at the end of the procedure. This is because in the code, If no error occurs, you must exit the procedure, before reaching the error handler.

Otherwise VB executes Error Handling code. On Error Resume Next : It tells VB application to suppress the standard error message and simply execute the next line of code.

If the file exist the kill procedure deletes it. But, it is suppressed due to an error resume next statement and procedure terminates normally. This has a number of properties. The most important properties are number and description.

Property Description Number Returns or sets a numeric value specifying an error. We use the Number property to determine which error occurred. The value of the property is a unique number that corresponds to the error condition. Syntax: Object.

Number Description Returns or sets an expression containing a descriptive string associated with an error. ActiveX Components. But some Objects in windows environment are not unique to Visual Basic and they do not come with visual basic language.

So, other applications provide these Objects and use them with in you applications. OLE Enables to access the functionality of multiple applications, with in single programming environment.

OLE is not a programming technique but it is a technology provided only in windows environment. OLE Terminology: 1. A Component is an Item a control or an application that some one else has developed. Compound Document: A document that contains more than a single type of Object is called a Compound Document. Container Application : An application that contains Linked or Embedded Objects is an container application.

Object Embedding: with this technique you can insert an Object from one application into another application. Object Linking: This technique is similar to Object Embedding except that the changes made to the Object Word or Excel in the server are reflected automatically in the container application.

By selecting the Object through insert Object dialog box. Embedding with Drag and Drop : 1. Immediately insert dialog box appears chick on cancel button.

Since we are Embedding Object using Drag and Drop. Start an application that supports OLE and open a file. In this exaple, we will start Microsoft Word application and insert a Word Document in the OLE container control by dragging and dropping the document Copy and paste. You can edit it with words Menus and Tool Bars.

Linking and Embedding with insert Object Dialog Box: 1. Immediately insert Object Dialog Box appears. From that Dialog Box select the option create from file option button and check the Check Box. Click on the browse button to locate the file you want to Embed. Immediately the selected file appears on the OLE container control.

ActiveX : What is ActiveX? ActiveX is a reusable and portable software component or control built according to what are called COM Component Object Model specifications. It is the brainchild of Microsoft. It provides a building block solution to complex problems. Visual Basic ActiveX Controls: When you start VB, the first window called the design window shows some 20 intrinsic controls like label, command button, option button etc.

These controls cannot be removed from the Toolbox. These controls can be added to or removed from the Toolbox. You will get the New Project Menu as shown in the figure 1. When you move the mouse pointer over the icon, the names of the controls will appear below them. The Components Dialog Box will appear on the screen as shown in the figure 3. Select the required control by clicking on the rectangular box at the beginning.

After selecting the required controls, click OK. The icons of the selected controls will now appear on the Tool box and you can use them just as you will use any other intrinsic ActiveX control.

This is in addition to the intrinsic controls already introduced in earlier versions. The Common Dialog Control enables the users to create Dialog Boxes open, save, print, setup, font, help and so on in their own applications. The Animation Control enables the users to play silent avi files producing animation appropriate to the operations performed.

The Communication Control describes how to use it with a modem to dial a phone number, interact with another modem or add advanced communication functionality to your applications. The ListView Control enables the users to organize and view the data in deifferent ways using the View Property. The MAPI Control enables the users to sign-on to an electronic messaging system, access an Inbox, send or receive messages or send file attachments.

The Masked -Edit Control enables the users to create mask platforms that prompt them for date, time currency or customized data input. The MSChart Control enables users to create barchrts, assign and edit backdrops and load data from an array. The Multimedia Control enables the users to control and manage t5he recording playback of a variety of multimedia using a simple push-button interface. The ProgressBar Control enables the users to get a feedback about a lengthy operation by pictorially displaying a moving coloured bar.

The Slider Control enables the users to select a range of data between a maximum and a minimum setting. The Sysinfo Control enables the users to determine the current operating system, how to monitor and respond to Plug and Play events or changes in AC and battery power status. The Tabbed Dialog Control enables the users to present several dialogs or screens of information on a single form using the same interface.

The TabStrip Control enables the users to create tabs by adding tab objects to the tab collection. Use an imagelist controlo to supply bitmaps for the tabs. This project requires a timer and two labels. The running time will be displayed in one label and the current date will be displayed in the other label. Drag one timer and two label controls into the form.

Give the labels appropriate size, font and border and set their caption property blank. Set the timer interval property as one second and the Enabled property as True. The project at the design time looks as in the below. Entering the Event Codes: Open the code window by double clicking the Timer control and enter the code as shown in the figure 4a. The clock will begin to run. The current date will be displayed in the other label.

The run mode window is as shown in the figure 5. Another important point you notice is that the timer control does not appear in the run mode, and is invisible, but works only from behind.

RichTextBox Control allows the user to enter text with varying fonts and sizes. Set the command button caption and name as font. A font dialog box can be opened only through the Common Dialog control. The Common Dialog control box will be invisible during run time. Save the form and the project. Enter the codes as shown in the below and finally save the project. ShowFont RichTextBox1. FontName RichTextBox1. FontSize RichTextBox1. FontBold RichTextBox1.

FontItalic RichTextBox1. You type any text in the RichTextBox and select it. Click the font button. The font dialog box will open. Set the desired font and size. On deselecting the text, you will find the text printed in the desired font and size. This includes a set of activities. These activities are 1. Preliminary Investigation 2. Determination of System Requirements 3. Design the System 4.

Development of Software 5. System Testing 6. Implementation and Maintenance. Preliminary Investigation : This activity has 3 parts. Request Classification 2. Feasibility Study 3. So, the project request must be examined to determine what the organizer wants? Feasibility Study: This activity determines whether the study requested is feasible or not.

There are 3 aspects in feasibility study i Technical Feasibility : can the project be done with current equipment, available persons and with existing software. Request Approval: Not all requested projects are feasible and desirable. So, the projects that are feasible and desirable must be put in to schedule.

Determination of System of Requirements : Analysis working closely with Employees and Managers must answer these question to determine the system requirements. What is being done? How is being done? How frequently does it occur? How well the task is being performed? To answer these questions systems analyst take to a verify of persons. Design to the System: The system design describes the data to be input, the data to be output and the procedures.

This information is passed to programming staff. So, that software development can begin, Designers are responsible for providing complete and clear information about the system to programmers. Development of Software: For the development of new system software developers install newly purchased software. System Testing: During system testing the system is used experimentally to test whether the system is according to the requirements. In this activity input is given to the system and the results are examined.

Implementation and Maintenance : Implementation is the process of checking the system have to be maintained that is modifications and changes will be made to the software to meet the new requirements. To draw such data flow diagrams, the different notations used are 1.

Process : This represents people procedures or devices that use or procedure data. Source or Destination : This may be people, programs or any other Entities. Data Store : The data store represents data bases each Component in Data Flow Diagram is labeled with a descriptive name.

Data Flow Diagrams allows analysts to study how the data enter the process and how they are changed when they leave the process. If the analyst want to review the overall system hw uses higher level Data Flow Diagrams. If they are instructed in studying one particular process they use lower level Data Flow Diagrams.

Using Data Flow Diagrams users can make suggestions for modifications more accurately. These are two types 1. Visual Basic has many built-in functions that are a part of the base language and may be called at any time from your procedures.

Cos ExpN This function returns the cosine of an angle angle in radians Sin ExpN This function Returns the sine of an angle angle in radians String Functions Len str This function returns the number of characters in a string expression Eg.

Eg: Me. Minute Returns an integer between 0 and 59, inclusive, that represents the minute of the hour corresponding to the time provided as an argument Month Returns an integer between 1 and 12, inclusive, that represents the month of the year for a date argument.

Practice Application: Program. By clicking the Microsoft Visual Basic 6. Double Click on the Command1 Ok , a Code window will appears. After the completion of a code Save the Project with appropriate name and run the project by pressing the Function Key F5.

The Output is Viewed as shown in figure. Procedure: 1. Output: Program. In the Form Design the Calculator which is shown in the right side by using the related Controls. Double Click the Form , the Code Window will appears.

Text End Sub 9. AddItem "Regular". AddItem "Bold". AddItem "Italic". FontCount List1. AddItem Screen. Fonts i Next End Sub 7. List Combo1. ListIndex Case "Regular" Text1. List List1. ListIndex End Sub 9.

After completion of the Code, save the project with an appropriate name and run the project by clicking on the F5 Function Key. Show End Sub 6. Show End Sub 7. AddItem Text1. Search Engine. Master object-oriented programming techniques for rapid bit development. Create professional-quality applications, components, and user interfaces faster and more efficiently than ever with the powerful object-oriented programming capabilities in the Visual Basic 6. From Windows common controls to data access, Internet, and ActiveX programming, this book covers core development topics for version 6.

Expedite development with the object-oriented capabilities in Visual Basic 6. NET Framework 2. Menu Skip to right header navigation Skip to main content Skip to secondary navigation Skip to primary sidebar Skip to secondary sidebar Free Visual Basic.

NET Books. Download free Visual Basic. It assumes no prior knowledge of programming, Visual Basic or the Visual Studio environment. Programming concepts are introduced and explained throughout the book. NET Programming by mkaatr - mkasoft.



0コメント

  • 1000 / 1000