textfield

if i create a button named add text feild in vb6.0 how can this button add a textfield on the form
[98 byte] By [georgeskada] at [2007-12-24]
# 1
Your question isn't very clear. I assume you want a button's Click event to add a TextBox control to a .NET form. Try this:

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim box As New TextBox
box.Location = New Point(10, 5)
box.Size = New Size(100, 20)
box.Name = "TextBox1"
box.Text = "nobugz waz here"
Me.Controls.Add(box)
End Sub

Add or modify properties as necessary to get the TextBox the way you want it...

nobugz at 2007-8-31 > top of Msdn Tech,Visual Basic,Visual Basic General...
# 2

This forum is intended to support Visual Basic.NET users. For suggested forums for VB6 questions, please see http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=551512&SiteID=1

Best regards,
Johan Stenberg

MSJohanStenberg at 2007-8-31 > top of Msdn Tech,Visual Basic,Visual Basic General...
# 3
i wanted to visual basic 6.0 not for visual basic.net
georgeskada at 2007-8-31 > top of Msdn Tech,Visual Basic,Visual Basic General...
# 4
I used to know this.. No, can't recall. Try posting at www.vbcity.com.
nobugz at 2007-8-31 > top of Msdn Tech,Visual Basic,Visual Basic General...