Dynamic creation of Controls 
Author Message
 Dynamic creation of Controls

        I'm using SSTab (Tab dialog box) in VB4.0 and I would like to create controls
for each tab DYNAMICALLY. I am reading a file which will dictate the number of
tabs and the controls for each tab to be displayed. I don't know at design time
how many tabs I will have and for each tab I do not know the types of controls.
        I would like to avoid to create at design time a set of arrays of all the
possible controls that each tab might support, and repeat that for each tab.

        My questions is if there is a way in VB4.0 to create controls related to each
tab at run-time.

Vartan Narikian

Fri, 01 May 1998 03:00:00 GMT  
 Dynamic creation of Controls


>    My questions is if there is a way in VB4.0 to create controls related to each
>tab at run-time.

This is a snippet from the help file that ships with the Designer
Widgets package (old 16bit Version) ...

This sample code shows how to use the same command buttons on each tab
using the Windows API function SetParent:
[declarations section]

Declare Function SetParent Lib "USER.EXE" (ByVal hWndChild As Integer,
ByVal hWndParent As Integer) As Integer

Sub SSIndexTab_Click (PreviousTab As Integer)

   Dim NewTab As Integer
   Dim rc As Integer

   NewTab = SSIndexTab.Tab
   rc = SetParent(cmdOK.Hwnd, SSIndexTab.TabHwnd(NewTab))
   rc = SetParent(cmdCancel.Hwnd, SSIndexTab.TabHwnd(NewTab))

End Sub

...It may work with the new VB4 / OCX version, let us know if you have
any success


Mon, 04 May 1998 03:00:00 GMT  
 [ 2 post ] 

 Relevant Pages 

1. Dynamic Creation of Controls

2. dynamic creation of controls?

3. Dynamic creation of Control Array on a SSTab

4. Dynamic Creation of Controls

5. Dynamic Controls Creation and Referencing the new Control.

6. Dynamic Control Creation, Controls object has no .Add ???

7. Dynamic creation of web controls in VB.NET

8. Dynamic Control Creation - Expand Form?

9. Dynamic control creation

10. Dynamic control creation and calling DOS programs from VB.

11. VB6-Dynamic Control Creation

12. Dynamic control creation-HOW???


Powered by phpBB® Forum Software