You are on page 1of 5

Q41. What is MDI? What are the advantages of MDI forms and its features?

The Multiple Document Interface (MDI) was designed to simplify the exchange of information among documents, all under the same roof. With the main application, we can maintain multiple open windows, but not multiple copies of the application. Data exchange is easier when we can view and compare many documents simultaneously. Multiple Word is a typical example. The main Form, or MDI Form, isn't duplicated, but it acts as a container for all the windows, and it is called the parent window. The windows in which the individual documents are displayed are called Child windows. At run time, an MDI form and all of its child forms take on special characteristics: All child forms are displayed within the MDI form's workspace. The user can move and size child forms like any other form; however, they are restricted to this workspace. When a child form is minimized, its icon appears on the MDI form instead of the taskbar. When the MDI form is minimized, the MDI form and all of its child forms are represented by a single icon. When the MDI form is restored, the MDI form and all the child forms are displayed in the same state they were in before being minimized. When a child form is maximized, its caption is combined with the caption of the MDI form and is displayed in the MDI form's title bar (see Figure 6.6). By setting the AutoShowChildren property, we can display child forms automatically when forms are loaded (True), or load child forms as hidden (False). The active child form's menus (if any) are displayed on the MDI form's menu bar, not on the child form. Advantages of MDI: MDI applications can often handle multiple documents more readily than SDI programs. For example, many MDI text editors allow the user to open multiple text files side by side in the same window, making it easy to compare and look up information from a second document while working on the first. MDI applications tend to perform more quickly than SDI programs, since only one version of the application is loaded into memory. Uses-> MDI applications can be used for a variety of purposes - for example, working on one document while referring to another document, viewing different presentations of the same information, viewing multiple Web sites at the same time, and any task that requires multiple reference points and work areas at the same time State what happens to parent form in the following situation: Child form is activated.:- Then the MDI parent form will contain the child form and menu of them will be merged and appear in a single menu of the MDI parent form.

Child form is minimized:- Then that child form will not appear in the desktop toolbar rather it will appear in the bottom left corner of MDI parent form will be available to give space for other MDI child form. Child form is maximized:- It will occupy the whole space of a MDI parent form as if it is the only form available with menu.

Q42. What is Seek Method? Which type of record set is available in this? The seek method of Record Set object can instantly locate a record in a table based on the value of an index field. The seek method is extremely fast because it uses the index of a table, and in effect, locates an item in a sorted list. The seek method has the following syntax: Seek operator, key The operator argument is one of the following relational operators: = (equal) > (greater than) < (less than) >= (greater or equal) <= (less or equal) The key argument is the value to be compared with the key field of the index. If the index is made up of a single field, key is a single value. If the index is made up of multiple fields, the key argument may contain multiple values, separated by commas. -> only table type record set support the Seek method.

Q43. What is default and cancel button? How can we set them. Default and Cancel buttons are command buttons which are used to initiate actions usually by clicking on it. The Caption property determines the text to display on the face of the button. The Default property, if set to true, means that the button will be activated (same as Clicked) if the <Enter> key is hit anywhere in the form. If Cancel is set to True, the button will be activated from anywhere in the form by the <Esc> key.

Q44. What is meant by module? Explain its type. Modules are building blocks of a project. A module is a collection of procedures, functions and event handlers. There are three kind of modules. 1) Form module: Form modules are the foundation of most visual basic applications. They have the file name .frm extension. They contain procedures that handle events and general procedures and form level declarations of variables, constants, types and external procedures. The declaration in the form module are private by default. 2) Class modules: Class modules are the foundation of object oriented programming in visual basic. They have the name .cls extension. We can write code in class modules to create new objects. These new objects can

include their own customised properties and methods. We need to write code for a class in a class module. We can then create objects of this class in other modules. 3) Standard module: Standard modules are containers for procedures and declarations accessed by other modules within the application. Standard modules have the file name .bas extension. They can contain global or module level declarations of variables, constants, types, external procedures and global procedures.

Q45. Compare Class module and Standard module. Class modules: 1) Public variables in a class module can only be accessed if we have an object variable containing a reference to a particular instance of a class. 2) Class modules are an implementation of object oriented programming. 3) All the objects have their own copies of member data. Standard modules: 1) Variables declared public in a standard module are visible from anywhere in the project. 2) Standard modules are an implementation of procedural language. 3) Only one copy of global variable exists.

Q46. Differentiate between Input Box and MSG Box? We can use msgbox for display the message and getting input from user like VB yes/no method, but inputbox only for input. For msgbox we can't set the x, y margin, but in the input box we can set. Q47. Differentiate between picture box and image box. i) The image in image box is stretchable but in picture box no stretchable. ii) we can access only bitmap files in the Image box but in picture box we can access both bitmap & JPEG files. iii) Picture box control takes up more memory and Image box control takes up less memory. Q47(a) What do we mean by properties, methods and events of an object. A property is an attribute of an object that defines one of the object's characteristics, such as size, colour, or screen location, or an aspect of its

behaviour, such as whether it is enabled or visible. To change the characteristics of an object, we change the values of its corresponding properties. A method is an action that an object can perform. For example, Add is a method of the Combo Box object, because it adds a new entry to a combo box. An event is an action recognized by an object, such as clicking the mouse or pressing a key, and for which we can write code to respond. Events can occur as a result of a user action or program code, or they can be triggered by the system. Q48. What is the relationship of properties, method and events? Although properties, methods, and events do different things, they're often interrelated. For example, if we move a control with the Move method (most likely in response to an event), one or more of the control's position properties (Top, Height, Left, and Width) will change as a result. Because the control's size has changed, the Resize event occurs. This interdependence means that we can sometimes accomplish the same task multiple ways in our code by manipulating object properties or methods.

Q49. Describe briefly all the file controls.

Three of the controls on the ToolBox that let us access the computer's file system are DriveListBox, DirListBox and FileListBox controls, which are the basic blocks for building dialog boxes that display the host computer's file system. Using these controls, user can traverse the host computer's file system, locate any folder or files on any hard disk, even on network drives. The file controls are independent of one another, and each can exist on it's own, but they are rarely used separately.

DriveListBox : Displays the names of the drives within and connected to the PC. The basic property of this control is the drive property, which set the drive to be initially selected in the control or returns the user's selection. DirListBox : Displays the folders of current Drive. The basic property of this control is the Path property, which is the name of the folder whose sub folders are displayed in the control. FileListBox : Displays the files of the current folder. The basic property of this control is also called Path, and it's the path name of the folder whose files are displayed.

Q50. Write syntax for loading, unloading, showing and hiding form.

(A) Use the Load statement to load a form into memory without making it visible yet. The Load statement will take only one argument: the name of the object to be loaded. Take a look at the following code: Load Form1 (B) When an individual form is no longer required, we can unload it from memory. This will release the graphic components from memory. The following code unloads the form Form1: Unload Form1 The Unload statement accepts a valid object name. (C) If the form is to be directly shown to the user, only the Show method is required. The loading of the Form object will take place automatically. The following line of code is required to both load the form and have it displayed: Form1.Show (D) If the form is no longer required to be on-screen, it can be removed from display by just using the Hide method. This keeps the form loaded but removes it from display. The following code demonstrates this: Form1.Hide

You might also like