please help me.textbox do not work well

L

lemonvital

i have a main form and i want to ada a childform,so i do it with the way
such as me.controls.add
code :
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button2.Click
If IsNothing(lead) Then
lead = New lead
lead.TopLevel = False
Me.Controls.Add(lead)
lead.Top = (Me.Height - lead.Height) / 2
lead.Left = (Me.Width - lead.Width) / 2
lead.Show()
Else
If lead.IsDisposed Then
lead = New lead
lead.TopLevel = False
Me.Controls.Add(lead)
lead.Top = (Me.Height - lead.Height) / 2
lead.Left = (Me.Width - lead.Width) / 2
lead.Show()
Else
lead.Activate()
lead.WindowState = FormWindowState.Normal
End If
End If
End Sub

but someting happen when i open childform,i can't edit the content of
textbox as well as usually.you copy the code to do ,you will find the
problem. can someboxy help me ? why this happen and how to solute?
 
J

Jerry

I think we will have to see the code for the lead class.
By the way. I never use simple names like "lead" for things. Although you
may be OK here, It is too easy to conflict with reserved keywords.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top