methods to swap forms into a vb form or control on a form

Is there a way to create VB forms (that will *never* be seen as individual forms) that would act as, for example, panels on a tabStrip control?

If you've seen Infragistics DataExplorer control (treeview/listview/pane combo), you can simply point to a form's hwnd property and it will display that form as part of the DataExporer control in the pane area.  That's the kind of stuff I want to do with standard VB6 controls if possible.

Summary: I want a main form and subforms that will be dynamically swapped into a control on the main form.

(sorry to be so verbose)

Who is Participating?
bobbit31Connect With a Mentor Commented:
if i understand you correctly:

Private Declare Function SetParent Lib "user32" (ByVal hWndChild As Long, ByVal hWndNewParent As Long) As Long

Private Sub Command1_Click()
    Form2.Top = 0
    Form2.Left = 0
    SetParent Form2.hWnd, Frame1.hWnd
End Sub

Private Sub Command2_Click()
    Form3.Top = 0
    Form3.Left = 0
    SetParent Form2.hWnd, Frame1.hWnd
End Sub

create three forms, form1, form2, form3... on form1 put a frame (frame1) though it could be any container.
For example, i put two command buttons (command1, command2). on command1 click i show form2 and set it's parent to frame1.
on command2 click, do the same for form3.

in the properties window, set moveable = false for form2 and form3 if you don't want the user to be able to move the form.

is this what you're looking for?
If you are new to VB you may be better of using ActiveX controls.  Unlesss you have already considered that option.

What you are describing above to me would typically be done using ActiveX controls.

An AcctiveX control acts and works very much like a form.
miloweAuthor Commented:
Beautiful!  Exactly what I'm looking for.  I'm surprised I've never heard of that API call...


All Courses

From novice to tech pro — start learning today.