I am attaching the a sample zip file with this post.This sample application contains 2 usercontrols, userdetails and projectselect.When the program is executed the userdetails will be loaded in an Internert Explorer window.There is a button in the userdetails.Also one controlarraay object for the projectselect usercontrol named porjectselect1(0).When the user clicks the button in the userdetails usercontrol, the projectselect should be loaded in the internert explorer window.but now it is not loading. The userdetails is remaining there in the usercontrol.
Some private declaration:
--------------------------
Private Declare Function GetClientRect Lib "user32" (ByVal hwnd As Long, lpRect As RECT) As Long
Private Declare Sub InitCommonControls Lib "COMCTL32" ()
Private Declare Function SetErrorMode Lib "kernel32" (ByVal wMode As Long) As Long
Private Declare Function GetParent Lib "user32" (ByVal hwnd As Long) As Long
Private Declare Function SetParent Lib "user32" (ByVal hWndChild As Long, ByVal hWndNewParent As Long) As Long
Public Property Get hwnd() As Long
hwnd = UserControl.hwnd
End Property
In Userdetails control, when the button is clicked:
------------------------------------------------
Private Sub Command1_Click()
Dim iIndex As Long
iIndex = projectselect1.Count
Load projectselect1(iIndex)
With projectselect1(iIndex)
.Visible = True
.SetFocus
End With
SetParent projectselect1(iIndex).hwnd, GetParent(UserControl.hwnd)
End Sub
-------------------------------
Could u please help me to sort out this,