mdi vs. sdi mdi – multiple document interface sdi – single document interface in an sdi...

7
MDI vs. SDI MDI – Multiple Document Interface SDI – Single Document Interface In an SDI application, each form acts independently of the others. A MDI project resembles applications such as Word and Excel which have a parent window and child windows. When you unload the parent form, all the child forms are unloaded. All the child forms display within the boundaries of the parent form.

Upload: lynette-davis

Post on 29-Dec-2015

227 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: MDI vs. SDI MDI – Multiple Document Interface SDI – Single Document Interface In an SDI application, each form acts independently of the others. A MDI

MDI vs. SDI

MDI – Multiple Document Interface

SDI – Single Document Interface

In an SDI application, each form acts independently of the others.

A MDI project resembles applications such as Word and Excelwhich have a parent window and child windows.

When you unload the parent form, all the child forms are unloaded.

All the child forms display within the boundaries of the parent form.

Page 2: MDI vs. SDI MDI – Multiple Document Interface SDI – Single Document Interface In an SDI application, each form acts independently of the others. A MDI

MDI Projects

A VB project can only have one MDI form which is the parent.

You can make other forms into child forms by setting theMDIChild property to True.

In an MDI project, you should make all nonparent forms into child forms, with the exception of the splash screen.

Page 3: MDI vs. SDI MDI – Multiple Document Interface SDI – Single Document Interface In an SDI application, each form acts independently of the others. A MDI

Creating an MDI Project

1. Add an MDI Form to the project by choosing Project/Add MDI Form.

Page 4: MDI vs. SDI MDI – Multiple Document Interface SDI – Single Document Interface In an SDI application, each form acts independently of the others. A MDI

Creating an MDI Project

2. Add other forms and set MDIChild Property to True.3. Set up Menus.4. Write code to load forms as needed.5. Make Windows Menu.

Page 5: MDI vs. SDI MDI – Multiple Document Interface SDI – Single Document Interface In an SDI application, each form acts independently of the others. A MDI

Menus in MDI Project

Key Idea:

If the parent form has a menu, its menu displays only if no child form with a menu is displaying.

If any child form has a menu, its menu replaces the parent form’s menu. (Just like in Excel and Word).

Page 6: MDI vs. SDI MDI – Multiple Document Interface SDI – Single Document Interface In an SDI application, each form acts independently of the others. A MDI

The Windows Menu

You can create a Windows menu – so your project will behave like other Windows applications.

Includes options for Cascade, Tile Horizontally, Tile Vertically and a list of the Windows.

To include the list of Windows, check the Window List option for the Menu Name

Page 7: MDI vs. SDI MDI – Multiple Document Interface SDI – Single Document Interface In an SDI application, each form acts independently of the others. A MDI

The Forms Collection

The Forms Collection consists of all the forms in a project that are loaded into memory.

The collection may contain MDI forms, MDI child forms, and Regular Forms.

You can refer to each form by using the index.

Example: Forms(0), Forms(1), Forms(2)

The Forms collection has a Count Property.