1

I have added a windows form on control panel using following code

Dim frmopen As New WinForm1
panel1.Controls.Add(frmopen)

Form opens normally work also but my concern is, I have one textbox on that WinForm1, when i am typing text in that textbox it takes input but when i am clicking in between that typed text the cursor goes to either last character or first character.

So if i have to enter characters in between, then first i have to erase the typed characters and then i have to type again.

Plz help me to work textbox normally??

Thank you

Navanath
  • 13
  • 2

1 Answers1

0

Try changing the child form's FormBorderStyle to None.

See: Windows Forms: Unable to Click to Focus a MaskedTextBox in a Non TopLevel Form

Public Class Form1

Private Sub Form1_Load(sender As Object, e As EventArgs) Handles Me.Load
    Dim frm2 As New Form2
    frm2.TopLevel = False
    frm2.FormBorderStyle = Windows.Forms.FormBorderStyle.None
    Me.Panel1.Controls.Add(frm2)
    frm2.Show()

End Sub

End Class
Community
  • 1
  • 1
Capellan
  • 717
  • 6
  • 15