1 / 13

Forms

Forms. Form. The form (.frm) and project (.vbp) files are saved as ASCII text. The structure of a form consists of: The version number of the file format. A block of text containing the form description. A set of form attributes. The Basic code for the form. Form1 - 1 VERSION 5.00

Télécharger la présentation

Forms

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Forms

  2. Form • The form (.frm) and project (.vbp) files are saved as ASCII text. The structure of a form consists of: • The version number of the file format. • A block of text containing the form description. • A set of form attributes. • The Basic code for the form.

  3. Form1 - 1 VERSION 5.00 Begin VB.Form Form1 Caption = "Form1" ClientHeight = 3195 ClientLeft = 60 ClientTop = 345 ClientWidth = 4680 LinkTopic = "Form1" ScaleHeight = 3195 ScaleWidth = 4680 StartUpPosition = 3 'Windows Default End

  4. Limitations Of a Single Project • Single project can contain up to 32,000 "identifiers" (any nonreserved keyword), which include, but are not limited to forms, controls, modules, variables, constants, procedures, functions, and objects. • Variable names in Visual Basic can be no longer than 255 characters, and the names of forms, controls, modules, and classes cannot be longer than 40 characters. • Visual Basic imposes no limit on the actual number of distinct objects in a project.

  5. Parts of a form • These are called design forms • Title bar-displays form’s title • Control box-maximize,minimize,close buttons • Main area where all controls are placed is called client area. • Form is sorrounded by a border

  6. Controls • Controls which enable the user to program to do things • Control is an object that can be drawn on a form object to enable user interaction with a application • Controls are associated with properties,methods and events. • Properties that define their behavior • An event is an action recognized by a control

  7. Events can occur as a result of user actions, program code or triggered by the system • Methods are procedures that operate on the object or that object performs on data. • Methods cause an object to perform an action or task.(Ex setfocus) object . method(arg1,arg2,….) are optional

  8. Classification • Three controls : standard /intrinsic, ActiveX, Insertable • Intrinsic controls: these are basic controls and available in every edition of VB(ToolBox) • ActiveX controls are placed in separate file as .VBX or .OCX extension (Listview, Treeview). TO use these controls the corresponding files must be included in the project • Insertable : Another application’s object from withinVB application Controls

  9. Modules • Code can be classified in three: • Class • Form • Standard • Each module can contain: • Procedure • Function • Property • Declarations • Constants • Variable

  10. Naming Conventions The names you give to forms and controls: • must begin with a letter. • must contain only letters, numbers, and the underscore character (_); punctuation characters and spaces are not allowed. • must be no longer than 40 characters.

  11. Value of the control • All controls have a property that you can use to store or retrieve values just by referring to the control, without using the property name. This is called the value of the control . • This is the most important or most commonly used property of the control.

  12. Form Control • Initialize event: When an instance of the form object is created • Load :form is loaded into the memory • Activate :when the form is displayed initially or when the user returns to the form • Deactivate: The form is hidden or move from one to another • QueryUnload :It determines how the unload was initiated • Unload: unloaded from the memory • Terminate :Form object is Destroyed

  13. Properties & methods of a Form • ScaleMode :Distance measurement (twips) • Height, Scaleheight • width • top • left • load • show • unload • Hide • Move

More Related