borderAndreaVB free resources for Visual Basic developersborder

borderAndreaVB Visual Basic and VB.NET source code resources - Copyright © 1999-2007 Andrea Tincaniborder

AndreaVB | Forum | News | Downloads | Register | Help | Member List | Statistics | Search | PM | Profile

Print This Topic
Previous Topic (Got one problem working with windows form?)Next Topic (How to insert picture in the cell of the datagrid ?) New Topic New Poll Post Reply
AndreaVB Forum : VB.Net : Dynamically Creating Controlls in VB.net
Poster Message
Chris_871
Level: Master


Registered: 30-11-2002
Posts: 106

icon Dynamically Creating Controlls in VB.net

Hai Friends

We can creating a controls  run time in VB.Net

for example , to load a textbox control dynamically in runtime

dim tx as new textbox()
me.controls.add(tx)
tx.name = "textbox1"
tx.text = "Hai I am dynamically created Text box"
tx.location = new point(100,100)


'If u want to add this control within a group box, u just bring it into front. To bring it to front add the following code

tx.bringtofront()



17-09-2003 at 06:27 AM
View Profile Send Email to User Show All Posts | Quote Reply
zimcoder
Level: VB Lord


Registered: 27-10-2003
Posts: 225
icon Re: Dynamically Creating Controlls in VB.net

Thanks for that piece .. but how can i dynamically resize my control for instance a textbox to accomodate the number of characters that my user is typing in??.

____________________________
BrainBench ADO.NET and ASP.NET Certified Developer

02-12-2003 at 08:21 AM
View Profile Send Email to User Show All Posts | Quote Reply
Chris_871
Level: Master


Registered: 30-11-2002
Posts: 106
icon Re: Dynamically Creating Controlls in VB.net

Hi

Just insert the following line

tx.Size = New Size(300, 10)

03-12-2003 at 06:46 PM
View Profile Send Email to User Show All Posts | Quote Reply
AndreaVB Forum : VB.Net : Dynamically Creating Controlls in VB.net
Previous Topic (Got one problem working with windows form?)Next Topic (How to insert picture in the cell of the datagrid ?) New Topic New Poll Post Reply
Surf To:


Not Logged In? Username: Password: Lost your password?
Partners: Download Actual Software | Free Software Download
borderAndreaVB free resources for Visual Basic developersborder

borderAndreaVB Visual Basic and VB.NET source code resources - Copyright © 1999-2007 Andrea Tincaniborder