|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
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 "BurntWithTime" <s***@lastdream.com> wrote in message Yes, you can. If you're wondering about the code, just create a simple VB news:P-ydnUQ4hOKSQcjYnZ2dnUVZ8smdnZ2d@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 > 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 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?ID=1139f14a-c236-4ad7-8882-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 Show quoteHide quote "pvdg42" <pvdg42@newsgroups.nospam> schreef in bericht news:uxcebDaBHHA.140@TK2MSFTNGP03.phx.gbl... > > "BurntWithTime" <s***@lastdream.com> wrote in message > news:P-ydnUQ4hOKSQcjYnZ2dnUVZ8smdnZ2d@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 >
Show quote
Hide quote
"Cor Ligthert [MVP]" <notmyfirstn***@planet.nl> wrote in message I thought he was asking if text boxes could be created in code, which they news:%23sxgjRbBHHA.3536@TK2MSFTNGP03.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?ID=1139f14a-c236-4ad7-8882-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 > 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. 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? Show quoteHide quote "pvdg42" <pvdg42@newsgroups.nospam> wrote in message news:%23mMitzdBHHA.1220@TK2MSFTNGP04.phx.gbl... > > "Cor Ligthert [MVP]" <notmyfirstn***@planet.nl> wrote in message > news:%23sxgjRbBHHA.3536@TK2MSFTNGP03.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?ID=1139f14a-c236-4ad7-8882-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. > "BurntWithTime" <s***@lastdream.com> wrote in message As I answered originally, yes, you can create the textboxes you need news:qOadnXD5JfOl1svYnZ2dnUVZ8sSdnZ2d@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? > > programmatically (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. Burnt,
>So basically the form is blank, but when it is loaded, the program checks In my idea not, in my idea is Peter answering you exactly how you creates >the database, and creates the text boxes that are needed. Does this make it >any clearer? > 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.DataColumns dim txtBox as new Textbox txtBox.Name is dc.ColumName 'set the position and other probertis of that textbox Controls.Add(txtBox) Next /// Than you have what you ask. With that hoping to end at least my confusion. Cor Show quoteHide quote "BurntWithTime" <s***@lastdream.com> schreef in bericht news:qOadnXD5JfOl1svYnZ2dnUVZ8sSdnZ2d@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" <pvdg42@newsgroups.nospam> wrote in message > news:%23mMitzdBHHA.1220@TK2MSFTNGP04.phx.gbl... >> >> "Cor Ligthert [MVP]" <notmyfirstn***@planet.nl> wrote in message >> news:%23sxgjRbBHHA.3536@TK2MSFTNGP03.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?ID=1139f14a-c236-4ad7-8882-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. >> > >
Location for shared Access database
Make copy of arraylist newbie: is this the appropriate use of a class? String manipulation question Getting the current procedure name? for each step order reverse direction ? single line string maninuplation substring, trim, indexof ? Installing .net assemblies windows installer Shared database without network tech required About Access Windows Service information |
|||||||||||||||||||||||