Megosztás a következőn keresztül:


Visual Basic Concepts

Interface Styles

If you've been using Windows-based applications for a while, you've probably noticed that not all user interfaces look or behave the same. There are two main styles of user interface: the single-document interface (SDI) and the multiple-document interface (MDI). An example of the SDI interface is the WordPad application included with Microsoft Windows (Figure 6.1). In WordPad, only a single document may be open; you must close one document in order to open another.

Figure 6.1   WordPad, a single-document interface (SDI) application

Applications such as Microsoft Excel and Microsoft Word for Windows are MDI interfaces; they allow you to display multiple documents at the same time, with each document displayed in its own window (Figure 6.2). You can recognize a MDI application by the inclusion of a Window menu item with submenus for switching between windows or documents.

Figure 6.2   Microsoft Excel, a multiple-document interface (MDI) application

In determining which interface style is best, you need to look at the purpose of the application. An application for processing insurance claims might lend itself to the MDI style — a clerk is likely to be working on more than one claim at a time or might need to compare two claims. On the other hand, a calendar application would be best suited to the SDI style — it's not likely that you would need more than one calendar open at a time; in the rare event that you did, you could open a second instance of the SDI application.

The SDI style is the more common; most of the examples in the Programmer's Guide assume an SDI application. There are a number of considerations and techniques unique to creating MDI applications, which are addressed in "Multiple-Document Interface (MDI) Applications" later in this chapter.

In addition to the two most common interface styles, SDI and MDI, a third interface style is becoming more popular: the explorer-style interface (Figure 6.3). The explorer-style interface is a single window containing two panes or regions, usually consisting of a tree or hierarchical view on the left and a display area on the right, as in the Microsoft Windows Explorer. This type of interface lends itself to navigating or browsing large numbers of documents, pictures, or files.

Figure 6.3   The Windows Explorer, an explorer-style interface

In addition to the MDI and SDI application examples that accompany this chapter, the Application Wizard provides a good way to compare the different interface styles. You can use the Wizard to generate a framework for each style and view the forms and code that it generates.

**For More Information   **To learn more about MDI applications, see "Multiple-Document Interface (MDI) Applications." The basics of working with forms are covered in "Forms, Controls, and Menus." For information on accessing the Application Wizard, see "Using Wizards and Add-Ins" in "Managing Projects."