From MDI to SDI

We’ll take it one step at a time and first look at how to link windows together without having to use the MDI. To do this, we will use the software catalog application that we developed earlier in this chapter. Well, we’ll develop the forms anyway—there’s no functionality within them for this project. You will find this project, shown in Figure 11-3, on the CD as SDIdemo.vbp.

Figure 11-3 The software viewer as an SDI application

The Windows API call that we’ll be using to create the interface is SetParent. Its declaration is as follows:

Declare Function WinSetParent Lib "user32" _
    Alias "SetParent" (ByVal hWndChild As Long, _
    ByVal hWndNewParent As Long) As Long

As you might be able to determine from Figure 11-3, a few changes have been made. Instead of all of the forms being child forms, we are now manipulating frames rather than forms. This is because the usual use of SetParent is to manipulate container controls, such as frames, picture boxes, and panels.