[RESOLVED] Forms in a picture box?
alrighty, here's what want to do.
On the left of my program, there is a tree view, and when a node is clicked, to the right of the tree, a new form loads.
Now, originally I was using an MDI form, with the trv in one child form, and then loading the other forms as children as well. This was working fine, but then I saw in another post, when looking for help on something else, a suggestion to use a picturebox to the left of the trv in the same form, and using the following (from here :
VB Code:
Private Declare Function SetParent Lib "user32" (ByVal hWndChild As Long, ByVal hWndNewParent As Long) As Long
Private Sub Form_Load()
SetParent Frame1.hWnd, Picture2.hWnd
I changed the code a little, I have a module, and in that mod there is a sub that is called for each form load (except the main one), so I added the code into the module instead of each form:
VB Code:
Public Declare Function SetParent Lib "user32" (ByVal hWndChild As Long, ByVal hWndNewParent As Long) As Long
Public Sub FormInit(frmRef As Form)
SetParent frmRef.hWnd, frmMainScreen.pctFormContain.hWnd
but whenever I click on a node, not only does nothing load in the picture box, the whole app seems to lose focus as well, any ideas?