Visual Basic 2010/2008 : How to add controls to your form without the form designer

preview_player
Показать описание
Ever wondered how to create new controls and add them to your form, without physically adding them to your form? Well now you can!

Thanks for watching!

Рекомендации по теме
Комментарии
Автор

Very Nice and Very natural, also very informative for a beginner, Gr8 Job
GOD Bless

hasanreza
Автор

textbox.Location = New System.Drawing.Point(x-val, y-val)* is the right way to go, no need to Dim x As ... then assign textbox.Location = x

ericjerets
Автор

"And now were gonna mess with the location ... ... keep in mind I've never done this before" LMAO

ILOKATsomuch
Автор

i see that you use 'addhandler' to add a sub without clicking the object..
but i am using VB 6.0 and i cant find 'addhandler' in this version of VB..
so can you please tell me what type of code that should i use to add a sub without clicking the object because i wanna add a textbox in runtime..

trybealive
Автор

Very informative. Thanks for sharing.
Want to know if i can dynamically add textbox in Form2 by putting some value in Form1.
Thanks alot

syedrummaanahmed
Автор

thanks for this interested information, but How can I available added new component to use it in VB 2010 Express? ( StatusBar item )? I added it but it unavailable ..

ahmedelprince
Автор

Hey...im new to vb.net and i ran into a problem just when i thought i was getting better at this.. but i hope you can help me so i can contineu with my life. My question is, when you dynamically add controls to the form, and after you close the form the runtime added controls is gone, do i have to make some kind of a database that will hold my controls and its values or is there another way of keeping dynamic controls on the form after you close the program. I hope you can help me.

masterkay
Автор

Tnx much for this i searching long time for that and finaly i found it tnx man i love you :D ;)

GhostMajoRX
Автор

Instead of using AddHandler use handles in your Sub for the control. Ex.

Private Sub button_Click() Handles button.click

ozoneDev
Автор

I just keep getting declaration expected.

BlueMeatBall