I've done this before, but I can't remember how I got it working (and why it won't now). I want to set a form as a child of another form. I know I need to use the SetParent API, but it's like it doesn't see that line. My project is set up with frmMain and frmChannel. Here's the frmMain code:
Public Class frmMain
#Region " Windows Form Designer generated code "
' The standard stuff goes here, taken out to save space
Private Declare Function SetParent Lib "user32" Alias "SetParent" (ByVal hWndChild As Long, ByVal hWndNewParent As Long) As Long
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim objTest As New frmChannel
According to http://www.allapi.net/
SetParent returns nonzero when it succeeds. When I used MsgBox to see what the output was, it was a really huge number (nonzero) but it didn't get set as a child. What am I doing wrong?
I'm using VB.NET 2003 in case you're wondering.