* New post Constructor Destructor and Inheritance& Array , Virtual base class in c++ language

Saturday, 20 July 2013

0 Variable in Visual Basics , Multiple Document Interface (MDI)

Variable in Visual Basics
A variable is a temporary stores space for number , text, object. Variables are constantly being created and destroy and will not held any value after our processor has ended , there are various type of  variable can be declared.

  1. Processor level variable = These variables declared with dim statement in the process where it gone to be used.
  2. Module level variable = These variable are created with a private statement in general declaration section of a form or code module. The value of module variable is available in every processor in that module.
  3. Global variable = These variable are created by public statement in general section of a form or code module. The value of global variable is available in every procesor or code module .

Rule for variable name

  • The variable name must began with letter.
  • The variable name can contain any mixture of letter and number.
  • The variable may include symbol with the expection of under.
  • The variable name may not have more then 40 chararcteristics. 
Types of variable declaration
  1. Implicit variable = In this type of declaration the visual basics automatically create the variable for us . The V.B automatically create the variable data types are varient.
  2. Explicit variable = It is another approach to declaration a variable explicit. We can declare the variable by following the keywards dim, static, private, public, the choice of keywards depends on programmer which scope you want to be used the variable.   
Syntax

Dim (var) a as integer (datatypes)

Multiple document interface (MDI)
The multiple document interface was designed to simplify the exchange of information among document, all under the same root with an MDI application , you can maintain multiple open form but not multiple copies of the application. Data exchange is easier when you can view and compare many document simultaneously.
                                   You can almost certainly use windows application that can open multiple documents at the same time and allow the user to switch among them with a mouse click microsoft word is a typical example , although most people use it in single document mode. Each document is displayed in its own window and all document window have the same behaviour. The main form or mdi form is not dublicated , but it acts as a contain for all other windows, and its called the parent form. The form in which the individual document are displayed are called child windows ( or document form) , when you reposition the parent form  on the desktop its child form follow . Chile form , however exist independently of the parent form, you can open and close child form as you want , & child form can even have different function.
 MDI application are not very common not too many , application lend themself to MDI implementation most of them are easier to implement with multiple form, but some application should be implemented with an MDI interface . These are the application that can open multiple document of the same type and use a common menu structure that applies to all open document. In the following section we are going to discuss the basic behaviour of MDI application , their differences form regular single document interface (SDI) application , & how to build MDI application.

MDI Application : Basics
An MDI application must have at least forms, the parent form and one or more then chile form . Each of these form has certain properties . These can be many child form conatin with in the parent form , but there can be only one parent form. 
                            The parent form may not contain any controls , while the parent form is open in design mode, the icons on the tool box are not disabled , but you cannot place any control on the form, the parent form can , and usually does, have its own menu.

To create an MDI , application, follow these steps:
  1. Start a new project and then choose project > Add MDI form to add the parent form.
  2. set the form caption to MDI window 
  3. Choose project > Add form to add a regular form.
  4. Make this form the child form by setting its mdi child property to true , to denote that this is a child form set its caption property to MDI child form. 
V.B automatically associates this new form with the parent form. The child form cannot be exist outside the parent form in otherwords, it can only be opened with in the parent form.

Variable in Visual Basics
A variable is a temporary stores space for number , text, object. Variables are constantly being created and destroy and will not held any value after our processor has ended , there are various type of  variable can be declared.

1.     Processor level variable = These variables declared with dim statement in the process where it gone to be used.
2.     Module level variable = These variable are created with a private statement in general declaration section of a form or code module. The value of module variable is available in every processor in that module.
3.     Global variable = These variable are created by public statement in general section of a form or code module. The value of global variable is available in every procesor or code module .

Rule for variable name
  • The variable name must began with letter.
  • The variable name can contain any mixture of letter and number.
  • The variable may include symbol with the expection of under.
  • The variable name may not have more then 40 chararcteristics. 
Types of variable declaration
1.   Implicit variable = In this type of declaration the visual basics automatically create the variable for us . The V.B automatically create the variable data types are varient.
2.   Explicit variable = It is another approach to declaration a variable explicit. We can declare the variable by following the keywards dim, static, private, public, the choice of keywards depends on programmer which scope you want to be used the variable.   
Syntax

Dim (var) a as integer (datatypes)

Multiple document interface (MDI)

The multiple document interface was designed to simplify the exchange of information among document, all under the same root with an MDI application , you can maintain multiple open form but not multiple copies of the application. Data exchange is easier when you can view and compare many document simultaneously.
                                   You can almost certainly use windows application that can open multiple documents at the same time and allow the user to switch among them with a mouse click microsoft word is a typical example , although most people use it in single document mode. Each document is displayed in its own window and all document window have the same behaviour. The main form or mdi form is not dublicated , but it acts as a contain for all other windows, and its called the parent form. The form in which the individual document are displayed are called child windows ( or document form) , when you reposition the parent form  on the desktop its child form follow . Chile form , however exist independently of the parent form, you can open and close child form as you want , & child form can even have different function.
 MDI application are not very common not too many , application lend themself to MDI implementation most of them are easier to implement with multiple form, but some application should be implemented with an MDI interface . These are the application that can open multiple document of the same type and use a common menu structure that applies to all open document. In the following section we are going to discuss the basic behaviour of MDI application , their differences form regular single document interface (SDI) application , & how to build MDI application.

MDI Application : Basics

An MDI application must have at least forms, the parent form and one or more then chile form . Each of these form has certain properties . These can be many child form conatin with in the parent form , but there can be only one parent form. 
                            The parent form may not contain any controls , while the parent form is open in design mode, the icons on the tool box are not disabled , but you cannot place any control on the form, the parent form can , and usually does, have its own menu.

To create an MDI , application, follow these steps:
1.     Start a new project and then choose project > Add MDI form to add the parent form.
2.     set the form caption to MDI window 
3.     Choose project > Add form to add a regular form.
4.     Make this form the child form by setting its mdi child property to true , to denote that this is a child form set its caption property to MDI child form. 
V.B automatically associates this new form with the parent form. The child form cannot be exist outside the parent form in otherwords, it can only be opened with in the parent form.

Features of MDI

1.     All child form are displayed within the MDI form work space.The user can move and size child form like any other form, however, they are restricted(limited) to this wark.
2.     When a child form is maximised , its combined with the caption of the MDI form and is displayed in the MDI title bar.
3.     By setting the autoshowchildren property, you can display child form automatically when form are loaded (true) or load child form as hidden (false).
4.     The active child form menus are displayed on the MDI form, menu bar, not on the child form.
5.     When a child form is minimised , its icons appear on the MDI form instead of the task bar.
Single Document Interface 

In Single document interface, there is only one document open and only any form for the user to view and modify . If the user open another document the current open is closed. In SDI , all the IDE windows are free to move anywhere on screen.
        An application than can support only one document at a time. 





0 comments:

Post a Comment

 

PROGRAMMINGqueen Copyright © 2011 - |- Template created by O Pregador - |- Powered by Blogger Templates

Blogger Widgets