Sei sulla pagina 1di 9

a method and objects to do something.

event is an activity methods are the blocks of the code that tell the control how to do things such as move to another location on the form for example : Move,Drag,Set Focus,Zorder. move : it changes and object position drag : it handles the execution of a drag and drop operation Set Focus : this method gives focus to the object specified in the method call.if focus refers to activation of a control Zorder : it determines the ordering which multiple objects appear on the screen Event : for example change : the user modifies text,in a text box click press mouse button double click drag drop drag over go to focus Edrop Epress Eup lost focus mouse down mouse move mouse up BASIC (Beginners all purpose symbolic instruction codes) properties : charcteristics can be thought of an objects attributes and method as its action and events as its responses. basic concept of visual program design in order to understand the application development process,it is helpful to understand some of the key concepts upon which visual basic build.VB is a windows development language. windows is a platform to execute the codes and programs.which are to support event dreven programming.these are qualities of basic concepts of visual design :

working of windows,events and messages. windows can be thought of as simply a rectangular region and with its code boundaries for example the document window or dialogue box command buttons : option button,menu bars,are windows. the windows operating system manages all of these many windows by assigning each one a unique ID number called window handle.the system continuesly monitors each of these windows for sign of an activity or in other words events. events can occur to user action such as Epress or mouse click. through programmatic control.message is the information or requests sent to the application in visual language programs. event driven model : an event driven application the code does not follow a predetermant path rather it executes different code sections in response to events.events can be trigered by the user . interactive development : writing compiler SDI(Single document interface) or MDI(Multiple document interface) interface for example ms word allows for several forms windows in special mode called MDI in which we can open multiple data documents within the same application. SDI : an application that requires only a single data window is called SDI.for example application windows notepad application,the user only 1 data document at a time(only 1 form is being executed) SDI application might support multiple forms.however these forms do not hold multiple data files but only provide extended support for extra dialogue box and secondary for screen. integrated development environment : In which we can develop, run, test and debug the application. 1)Standard executed file 2)active executed file,ActiveX DLL - active exe files are OLE (object linking and embedded).OLE automation servers.ActiveX

components are basic code building components that don't have a visible interface and that can add special functionalities to your application but are packed differently as executable files are DLL. 3)ActiveX control : such as text box are command buttons control is a basic element of user interface.activatex documents controls that comes with VB. 4)ActiveX document executable files 5)VB applications Wizard 6)Data project 7) DHTML application 8)IIS application (internet information server)-in IIS in-built application that run on the web server and interact with clients over the internet with internet information server 9)VB Enterprise edition controls it create a new standard executable project and loads all the tools of the enterprise edition of visual basic. Menu Bars : file edit view project format debug run query diagram tools windows help Programming Visual Basics 1)variables are name storage locations whose values can be manipulated during the execution of the programs means during the program run. 2)data types in VB : Character, Integer, Real, String-each type of data is ended in a different manner. a data types is a means to identify the type of data and associated operation with it. Boolean operations (T/F) Byte is a positive integer: no decimal in the range 0 - 255 Currency Date Double : 14 digits,range 0-13 Integer : non fractional value,range -32768 - +32768 Long Object : controls of forms

Single : Numeric values,up to 6 digits of precision String : codes multiple characters textual data it can store data having digits alphabets and other characters -------------------------------------------------Variables syntax Dim<Var name>[As(Data types)][,<var name>[As<Data type>]] example : dim roll no as byte categories of datatypes - Numeric Data types : consist of numbers which can be used in calculation byte storages. Byte integers 2 Bytes long 4 Bytes Doube 8 Bytes Currency 8 Bytes Decimal 8 Bytes - Non Numeric Data types : that can not be participate in calculation.for example a string are true values who are stored form, etc. fixed length string variable length string -------Date Boolean Object Declaration Characters Alternative way of specifying data type while declaring variables is the use of some special characters in place of data types.these special characters that specified data type are known as type declaration characters. Syntax : Dim<Var name><Type-declaration character>

example : Dim<var name><i%> -----> in here i is as integer variable example : Dim s$ -----> String variable Dim a@ -----> currency variable Dim ph& -----> long variable fixed length string and variable length string string is a data element which can store some information is composed of characters and it requires 1 byte for its storage. the number of characters inside a string determines its string width.there can be fixed string and variable length string. in fixed length string means they occupy fix number of bytes for every data element they store.these number of bytes are determined by maximum number of characters that the string can store. these not necessarily all data elements inside a string are of the same length but the fixed length string some space always wasted as all data elements do not use all the space reserved for processing.but processing is much simpler in case of fixed length strings. variable length string : have varied length,means string length is determined separately for every data element inside a string. variable length string declaration : for example : Dim<string company name> [as<string>] Literals : a literal is a value that does not change.string literal must be enclosed within a quotation marks for example : "Maithli", "Kush", "CBSE" data and time must be enclosed by # for example : #22-Jan-2003#,# 9:43#,# 4:17 pm# or #september 24,1968# 13& Long literals

13! String literal 13# Double literal 13@ Currency literal Constant is a fixed value means a value that doesn't change whereas a literal is a certain data value. Implicit and explicit variable declaration x=13 y=7 z=x+y Dim A1 as integers,A2,A3 in here variable A1 as integer type variable,but variables A2 and A3 will be implicitly variant types. for example : Dim A% Dim B$ Dim C@ -----------------------------------------------------------Create a form in VB draw a label in the form and set properties. Caption Property Application Form Font Bookman oldstyle Bold 12pts also draw labels on your forms such as Name, Sex, Qualification, post applied for, Hobbies. Text Box in the text box property in miscelenous category txt name Caption property display the text box Behaviour Category Max Length 40

Option Buttons such as Sex option Combo box is same as pop-ups.such as qualification label List Category such as post applied for option.example : Teachers, editor, Journalist, Coach check boxes for Hobbies set captions for check boxes Music chk Music Painting chk painting Reading chk reading Writing chk writing Command Buttons : such as Submitt and clear Buttons cmd submitt private sub cmd clear_click() txt name.text=" " opt male.value=true cmb qual.text="B.A" chk music.value=False chi read.value=False chi write.value=False End sub Private Sub cmd submit submit_click() msg-box (txt name.text+" "+cmd qual.text end sub Static Variables is not removed from memory even after its procedures is over.thus it retains its value static<var name>as<data type> private to the procedure

developer variable shows the same value whereas static variable gets implemented every time. is initialised when the procedure is executed first time and after the increment takes place in its previous value it is not reinitialised every time. example : static variable Procedure being called for -------- time local variable -------static variable -------increment variable --------exit ----------------------------------------------use a mouse to click a button.move to focus to the button by pressing TAB key and then choose the button by pressing the space bar and enter keys. you may also involve the click event procedure of a command button by setting its value property true cmdok.value=true by calling its click event procedure by just typing its name a subroutine is a block of statements that carries out a well defined task.the blocks of the statements is placed with a pair of sub and end sub and can be invoked by name. a function is similar to subroutine ,but a function returns a result. subroutines perform a task and do not record anything to the calling program.functions commonly carry out calculations and report the result.the statements that make up a function are placed in a pair of function/endfunction. ---------------------------------------control arrays is a group of controls that share the same name and type. they also share the same event procedures.a control array has

at least 1 element and can grow to as many elements as your system resources and memory format.the maximum index we can use in a control array is 32767. adding controls with control array uses fewer resources than simply adding multiple controls of the same type.control arrays are useful if we want several controls to share code.if three option buttons are created as a control array,the same code is executed regardless of which button was clicked.there are 3 ways to create a control array at design time. 1)assign the same name to more than one control. 2)copy an existing control and the paste it to the form set the control index property to a value that is not null. a pop-up menu is a floating menu that is displayed over a form, it is independent of the menu bar. popupmen

Potrebbero piacerti anche