Results 1 to 3 of 3

Thread: Control Array

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Dec 2000
    Location
    Cairo, Egypt
    Posts
    126

    Post Control Array

    Hi All;
    I know how to make a control array in run time for normal control and form but I want to make a control array of frame with its contents within a tab control to make each tab contain one index of the frame and its content control(s). How can I do it????

  2. #2

  3. #3
    Former Admin/Moderator MartinLiss's Avatar
    Join Date
    Sep 1999
    Location
    San Jose, CA
    Posts
    33,431

    Re: Control Array

    Labels won't work with this.
    VB Code:
    1. Option Explicit
    2. Private Declare Function SetParent Lib "user32" (ByVal hWndChild As Long, ByVal hWndNewParent As Long) As Long
    3. Private Sub Command1_Click()
    4.     Dim lngTab As Long
    5.     Dim lngSaveLeft As Long
    6.    
    7.     lngSaveLeft = Frame1(0).Left
    8.    
    9.     For lngTab = 2 To SSTab1.Tabs
    10.         SSTab1.Tab = lngTab - 1
    11.         Load Frame1(lngTab - 1)
    12.         SetParent Frame1(lngTab - 1).hWnd, SSTab1.hWnd
    13.         Frame1(lngTab - 1).Visible = True
    14.         ' This is important. The tab control operates by moving controls off
    15.         ' and back on the screen so we need to use the saved value of the
    16.         ' original frame or you won't be able to see them
    17.         Frame1(lngTab - 1).Left = lngSaveLeft
    18.         Load Text1(lngTab - 1)
    19.         Text1(lngTab - 1).Visible = True
    20.         SetParent Text1(lngTab - 1).hWnd, Frame1(lngTab - 1).hWnd
    21.     Next
    22. End Sub

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width