472,334 Members | 2,217 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,334 software developers and data experts.

Creating TextBoxes Dynamically

In my previous posting I failed miserably, to give enough information to get
my difficulty apparent.

So to start again. I want to create textboxes dynamically in VB.NET. This
is not a web application that I'm trying to build. I should add that i am a
very new user to VB.NET and as such am very ignorant so please excuse this.

Many thanks for any assistance.

regards

Brian
Jul 21 '05 #1
2 9986
Hi Brian,

To create any kind of object dynamically you just call its constructor.

TextBox t = new TextBox();

This will create a TextBox object and store a reference to it in 't'.

Before you can see it you also need to add it to a container object, like
a windows form

Me.Controls.Add(t)

You should now be able to see a TextBox at the default position with
default size.

To create several TextBoxes, repeat the code above.
To keep track of the various TextBoxes you can set the TextBox.Name
property, store the references in various lists etc.
On Mon, 14 Feb 2005 04:15:02 -0800, Briand
<Br****@discussions.microsoft.com> wrote:
In my previous posting I failed miserably, to give enough information to
get
my difficulty apparent.

So to start again. I want to create textboxes dynamically in VB.NET.
This
is not a web application that I'm trying to build. I should add that i
am a
very new user to VB.NET and as such am very ignorant so please excuse
this.

Many thanks for any assistance.

regards

Brian


--
Happy Coding!
Morten Wennevik [C# MVP]
Jul 21 '05 #2
Hi Morten

Many thanks for the info, I'll give it a go

Brian

"Morten Wennevik" wrote:
Hi Brian,

To create any kind of object dynamically you just call its constructor.

TextBox t = new TextBox();

This will create a TextBox object and store a reference to it in 't'.

Before you can see it you also need to add it to a container object, like
a windows form

Me.Controls.Add(t)

You should now be able to see a TextBox at the default position with
default size.

To create several TextBoxes, repeat the code above.
To keep track of the various TextBoxes you can set the TextBox.Name
property, store the references in various lists etc.
On Mon, 14 Feb 2005 04:15:02 -0800, Briand
<Br****@discussions.microsoft.com> wrote:
In my previous posting I failed miserably, to give enough information to
get
my difficulty apparent.

So to start again. I want to create textboxes dynamically in VB.NET.
This
is not a web application that I'm trying to build. I should add that i
am a
very new user to VB.NET and as such am very ignorant so please excuse
this.

Many thanks for any assistance.

regards

Brian


--
Happy Coding!
Morten Wennevik [C# MVP]

Jul 21 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Bhavin | last post by:
Anybody quickly replies it, would be a great help! I try to create dynamic array of textboxes control in ASP.NET(C#). I got the following error...
10
by: Tony | last post by:
Is there a recommended way to have a form that is a list of textboxes from a sql table based on a username that then puts the captured data back...
2
by: Briand | last post by:
In my previous posting I failed miserably, to give enough information to get my difficulty apparent. So to start again. I want to create...
5
by: BLACKDOG157 | last post by:
I've made a form with a variable number of textboxes. The user fills them out, and then I need to pick up the values he has filled in. The number...
1
by: Sirisha | last post by:
Hi, I want javascript for displaying multiple textboxes dynamically. ADD-this is button. if i click button first time it will display 1 textbox...
2
by: osakthivel | last post by:
hello sir, I have one problem.I want to createtexboxes dynamically using javascript when textbox onblur event.after creating textboxes if...
5
by: tshad | last post by:
I found I can create Template columns dynamically - as long as I don't use objects that need onclick events, such as a LinkButton. Textboxes and...
4
by: ashwinigopi | last post by:
Hi I am a fresher to .net just taking classes for .net. I got a task whic i have a basic idea but dont know how to proceed. Heres the task create a...
1
by: bharathi228 | last post by:
hi, iam doing a windows application.i have a requirement like to create labels and textboxes dynamically at runtime.iam giving input as number of...
0
by: concettolabs | last post by:
In today's business world, businesses are increasingly turning to PowerApps to develop custom business applications. PowerApps is a powerful tool...
0
by: teenabhardwaj | last post by:
How would one discover a valid source for learning news, comfort, and help for engineering designs? Covering through piles of books takes a lot of...
0
by: CD Tom | last post by:
This happens in runtime 2013 and 2016. When a report is run and then closed a toolbar shows up and the only way to get it to go away is to right...
0
by: CD Tom | last post by:
This only shows up in access runtime. When a user select a report from my report menu when they close the report they get a menu I've called Add-ins...
0
jalbright99669
by: jalbright99669 | last post by:
Am having a bit of a time with URL Rewrite. I need to incorporate http to https redirect with a reverse proxy. I have the URL Rewrite rules made...
0
by: antdb | last post by:
Ⅰ. Advantage of AntDB: hyper-convergence + streaming processing engine In the overall architecture, a new "hyper-convergence" concept was...
2
by: Matthew3360 | last post by:
Hi, I have a python app that i want to be able to get variables from a php page on my webserver. My python app is on my computer. How would I make it...
0
by: AndyPSV | last post by:
HOW CAN I CREATE AN AI with an .executable file that would suck all files in the folder and on my computerHOW CAN I CREATE AN AI with an .executable...
0
by: Arjunsri | last post by:
I have a Redshift database that I need to use as an import data source. I have configured the DSN connection using the server, port, database, and...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.