473,378 Members | 1,470 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 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 10058
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 while I tried to assign value to ID property of...
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 into the db? I have a table |userid|skill|level|....
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 textboxes dynamically in VB.NET. This is not a web...
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 of textboxes vary depending on a value that the...
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 and if i click 2nd time it will display another...
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 i submit the form the dynamically created...
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 Labels work fine. I create the Template columns...
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 form with a textbox and two buttons 'Show' and...
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 labels,and textboxes then it will created...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.