Ugh I know my friend hates this, but I solved my own problem before someone could help or come up with their own solution..
So the solution? Well I always say "When all else fails, API it!" This is another case I had to resort to that.. I found when setting the forms TopLevel = False was there when the bug arose. So I had to avoid having to change that value while still being able to add the form to a parenting form. The answer: SetParent api.
Here's a quick snippit code that demonstrates:
vbnet Code:
Public Class Form1 Friend Declare Function SetParent Lib "user32" (ByVal hWndChild As IntPtr, ByVal hWndNewParent As IntPtr) As Integer Private Sub Form1_Load( ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Dim nForm As New Windows.Forms.Form() Dim nTextBox As New Windows.Forms.TextBox() nTextBox.Location = New Point(0, 0) nTextBox.Size = New Size(158, 20) nTextBox.Text = "Sample text" SetParent(nForm.Handle, Me.Handle) nForm.Show() End Sub End Class
The result is a form within the parent from, whom contains normal funtioning textbox controls![]()





Reply With Quote
