473,722 Members | 2,430 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Creating text boxes on the fly?

Hello everyone,
Please can anyone tell me if it is possible for a VB.NET application to
check a database and then create textboxes on a form that correspond to
those records on the database? For example, say I had a table in a DB that
contained movie subjects: Horror, Sci-Fi, Comedy etc. Would it be possile
for the VB app to look at these and then create the text boxes Horror,
Sci-Fi and Comedy?

Thanks,
BWT
Nov 11 '06 #1
6 3433

"BurntWithT ime" <sa**@lastdream .comwrote in message
news:P-*************** *************** @bt.com...
Hello everyone,
Please can anyone tell me if it is possible for a VB.NET application to
check a database and then create textboxes on a form that correspond to
those records on the database? For example, say I had a table in a DB that
contained movie subjects: Horror, Sci-Fi, Comedy etc. Would it be possile
for the VB app to look at these and then create the text boxes Horror,
Sci-Fi and Comedy?

Thanks,
BWT
Yes, you can. If you're wondering about the code, just create a simple VB
Windows app, place a textbox on the form, then have a look at the generated
code. In VS 2005, display all files, then look at <your form
name>.designer. vb
Nov 11 '06 #2
Peter,

In my idea you cannot do anymore what the OP is asking, in classic VB there
is I thought the name was a DataBaseProject or something like that, that
makes a complete form for you using the database. Now it is back in 2.0
with, however there it uses the datagridview and no textboxes.

http://www.vb-tips.com/dbpages.aspx?...2-b1ed16424252

I was asking myself why I had not answered this question and than felt the
quarter.

This is an often used phrase in Dutch. (Toen viel het kwartje) although the
quarter does not exist anymore in the Euro.

In fact he is in my opinion asking for Office MS Access

Cor
"pvdg42" <pv****@newsgro ups.nospamschre ef in bericht
news:ux******** *****@TK2MSFTNG P03.phx.gbl...
>
"BurntWithT ime" <sa**@lastdream .comwrote in message
news:P-*************** *************** @bt.com...
>Hello everyone,
Please can anyone tell me if it is possible for a VB.NET application to
check a database and then create textboxes on a form that correspond to
those records on the database? For example, say I had a table in a DB
that contained movie subjects: Horror, Sci-Fi, Comedy etc. Would it be
possile for the VB app to look at these and then create the text boxes
Horror, Sci-Fi and Comedy?

Thanks,
BWT
Yes, you can. If you're wondering about the code, just create a simple VB
Windows app, place a textbox on the form, then have a look at the
generated code. In VS 2005, display all files, then look at <your form
name>.designer. vb

Nov 11 '06 #3

"Cor Ligthert [MVP]" <no************ @planet.nlwrote in message
news:%2******** ********@TK2MSF TNGP03.phx.gbl. ..
Peter,

In my idea you cannot do anymore what the OP is asking, in classic VB
there is I thought the name was a DataBaseProject or something like that,
that makes a complete form for you using the database. Now it is back in
2.0 with, however there it uses the datagridview and no textboxes.

http://www.vb-tips.com/dbpages.aspx?...2-b1ed16424252

I was asking myself why I had not answered this question and than felt the
quarter.

This is an often used phrase in Dutch. (Toen viel het kwartje) although
the quarter does not exist anymore in the Euro.

In fact he is in my opinion asking for Office MS Access

Cor
I thought he was asking if text boxes could be created in code, which they
can. The issue of where to obtain the data to populate the text property is
secondary. If the OP wants to write the code to create a textbox in a method
called based on some event occurring, then populate the text property of the
new textbox with data (or metadata) retrieved from a database, that's easily
done as well.

Of course, if what the OP is looking for is automatic form generation,
you're right.
Nov 11 '06 #4
Thanks for the replies people.
There seems to be some confusion. I do not want to create the entrie form
automatically, just create the text boxes automatically. So basically the
form is blank, but when it is loaded, the program checks the database, and
creates the text boxes that are needed. Does this make it any clearer?
"pvdg42" <pv****@newsgro ups.nospamwrote in message
news:%2******** ********@TK2MSF TNGP04.phx.gbl. ..
>
"Cor Ligthert [MVP]" <no************ @planet.nlwrote in message
news:%2******** ********@TK2MSF TNGP03.phx.gbl. ..
>Peter,

In my idea you cannot do anymore what the OP is asking, in classic VB
there is I thought the name was a DataBaseProject or something like that,
that makes a complete form for you using the database. Now it is back in
2.0 with, however there it uses the datagridview and no textboxes.

http://www.vb-tips.com/dbpages.aspx?...2-b1ed16424252

I was asking myself why I had not answered this question and than felt
the quarter.

This is an often used phrase in Dutch. (Toen viel het kwartje) although
the quarter does not exist anymore in the Euro.

In fact he is in my opinion asking for Office MS Access

Cor
I thought he was asking if text boxes could be created in code, which they
can. The issue of where to obtain the data to populate the text property
is secondary. If the OP wants to write the code to create a textbox in a
method called based on some event occurring, then populate the text
property of the new textbox with data (or metadata) retrieved from a
database, that's easily done as well.

Of course, if what the OP is looking for is automatic form generation,
you're right.

Nov 11 '06 #5

"BurntWithT ime" <sa**@lastdream .comwrote in message
news:qO******** *************** *******@bt.com. ..
Thanks for the replies people.
There seems to be some confusion. I do not want to create the entrie form
automatically, just create the text boxes automatically. So basically the
form is blank, but when it is loaded, the program checks the database, and
creates the text boxes that are needed. Does this make it any clearer?

As I answered originally, yes, you can create the textboxes you need
programmaticall y (IOW, your program will create the needed controls after
querying the database to see what is needed).

My first response told you where to find example code for control creation,
if you need something more explicit, ask away.

--
Peter [MVP Visual Developer]
Jack of all trades, master of none.
Nov 12 '06 #6
Burnt,
>So basically the form is blank, but when it is loaded, the program checks
the database, and creates the text boxes that are needed. Does this make it
any clearer?
In my idea not, in my idea is Peter answering you exactly how you creates
text boxes on the fly.

However, although it is in your subject is in my idea in your text not what
at least in these newsgroups is called "creating text boxes on the fly".

Or you should make yourself a program as Peter wrotes, that checks the
content of the datatables and make as many textboxes as there are
datacolumns in your dataset.

Something as

\\\
For each dc as datacolum in myDataTable.Dat aColumns
dim txtBox as new Textbox
txtBox.Name is dc.ColumName
'set the position and other probertis of that textbox
Controls.Add(tx tBox)
Next
///

Than you have what you ask.

With that hoping to end at least my confusion.

Cor

"BurntWithT ime" <sa**@lastdream .comschreef in bericht
news:qO******** *************** *******@bt.com. ..
Thanks for the replies people.
There seems to be some confusion. I do not want to create the entrie form
automatically, just create the text boxes automatically. So basically the
form is blank, but when it is loaded, the program checks the database, and
creates the text boxes that are needed. Does this make it any clearer?
"pvdg42" <pv****@newsgro ups.nospamwrote in message
news:%2******** ********@TK2MSF TNGP04.phx.gbl. ..
>>
"Cor Ligthert [MVP]" <no************ @planet.nlwrote in message
news:%2******* *********@TK2MS FTNGP03.phx.gbl ...
>>Peter,

In my idea you cannot do anymore what the OP is asking, in classic VB
there is I thought the name was a DataBaseProject or something like
that, that makes a complete form for you using the database. Now it is
back in 2.0 with, however there it uses the datagridview and no
textboxes.

http://www.vb-tips.com/dbpages.aspx?...2-b1ed16424252

I was asking myself why I had not answered this question and than felt
the quarter.

This is an often used phrase in Dutch. (Toen viel het kwartje) although
the quarter does not exist anymore in the Euro.

In fact he is in my opinion asking for Office MS Access

Cor
I thought he was asking if text boxes could be created in code, which
they can. The issue of where to obtain the data to populate the text
property is secondary. If the OP wants to write the code to create a
textbox in a method called based on some event occurring, then populate
the text property of the new textbox with data (or metadata) retrieved
from a database, that's easily done as well.

Of course, if what the OP is looking for is automatic form generation,
you're right.


Nov 12 '06 #7

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

Similar topics

4
561
by: Altramagnus | last post by:
I have 30 - 40 type of different window. For each type I need about 20 instances of the window. When I try to create them, I get "Error creating window handle" My guess is there is a maximum number of window handle, because if I reduce to about 2 instances of each window, it can run. But not 20 instances of each window. Does anyone know what the problem is? is it really because it exceeds the maximum number of window handle?
2
5966
by: Iain Miller | last post by:
Now this shouldn't be hard but I've been struggling on the best way as to how to do this one for a day or 3 so I thought I'd ask the assembled company..... I'm writing an application that tracks a group of Sales people, the customers they deal with and the business they transact with them. I've got my head around all the tables & some of the basic Query structures OK and am beginning to delve into creating the forms I need to be able...
2
12621
by: Yoshitha | last post by:
hi I have 2 drop down lists in my application.1st list ontains itmes like java,jsp,swings,vb.net etc.2nd list contains percentage i.e it conatains the items like 50,60,70,80,90,100. i will select any skill in 1st drop down list then i'll select % of this skill in the 2nd list box , based on the percentage i've selected in the 2nd list box it has to display 2 sets of drop down list boxes at run time one for selecting skill and
3
1467
by: DeanL | last post by:
Hi All, I need some help regarding the creation of an auditing facility with Access 97. First off, let me say that the following design is not my idea but I'm in the unfortunate position of trying to implement it somehow. First, the user(s) require that certain fields be audited to see who the data was last changed by and when it was changed. They initially wanted this data to be in the ControlTip Text so they could see it by
4
1883
by: DeanL | last post by:
Hi Guys, I need some help creating a query that is going to take between 1 and 10 parameters. The parameters are entered on a form into text boxes that may have data or be empty. Is there a way to create a single query that will take parameters if they are present in the text boxes and not take parameters if the text box is empty? The ten fields will need to be searched using "Like" so that the user can search on part of a text...
1
1762
by: dhwanimathur | last post by:
hi all this is my first post in this forum, i am beginner of JSP but since i work in organisation i have to work in Dreamweaver IDE directly instaed of textpad so i need help in creating JSP i am not familiar to the environmnt of Dreamweaver i just wrote some html code as below
1
3752
by: skyson2ye | last post by:
Hi, guys: I have written a piece of code which utilizes Javascript in PHP to create a three level dynamic list box(Country, States/Province, Market). However, I have encountered a strange problem, and I have spent three days trying to debug but to no avail. Everything is OK when there are only two dependent list boxes, but when adding the third child list box, a problem appears: if I populate the third box only with the value: new...
5
7784
by: ofilha | last post by:
I have created a report in design mode. However, some of the fields i need are dynamic. That is, i have a series of fields text boxes mostly that must show up only as needed. I also have some labels that also should dynamic depending on the text boxes. I first tried createReportcontrol during the OnOpen event for the report,and when i tried to run it, it would give me an error 2147, that i must be in design view in order to create or delete...
3
2143
by: susanhouser | last post by:
I am having some difficulty placing a footer on my web page. I want the footer to automatically move down as more content is added. I did this by creating a relative box for the content and placing the footer below it in a relative position. The trouble is, my content is in several relative boxes within the main box, and when I position them from the top, the main box does not expand to include them. It stays the height of the boxes it...
0
8739
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9238
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9157
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9088
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
5995
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4502
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4762
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
2602
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2147
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.