How can I add a textbox into the form by using vb.net code for my web application?
I write the following code but the textbox didn't appear:
Dim newTxt As TextBox = New TextBox()
newTxt.Wrap = True
newTxt.Text = "Hello"
Me.Controls.Add(newTxt)
Printable View
How can I add a textbox into the form by using vb.net code for my web application?
I write the following code but the textbox didn't appear:
Dim newTxt As TextBox = New TextBox()
newTxt.Wrap = True
newTxt.Text = "Hello"
Me.Controls.Add(newTxt)
make sure you choose the correct location for it....Quote:
Originally posted by Lim
How can I add a textbox into the form by using vb.net code for my web application?
I write the following code but the textbox didn't appear:
Dim newTxt As TextBox = New TextBox()
newTxt.Wrap = True
newTxt.Text = "Hello"
Me.Controls.Add(newTxt)
newTxt.Location = new point (....
But 'location' is not a member of 'System.Web.UI.WebControls.TextBox'
are you making a web application ? perhaps you would post this in the ASP.NET section then. (if that's asp:D, I really dunno anything about web apps)Quote:
Originally posted by Lim
But 'location' is not a member of 'System.Web.UI.WebControls.TextBox'
I just tried this in a windows form applicatoin and it worked. (textbox inherits from system.windows.forms when making win form apps)
Dim txt As New TextBox()
Me.Controls.Add(txt)