473,412 Members | 2,306 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,412 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 10059
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...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.