to crete textbox at runtime in VB.NET

mrani

Member
Joined
Jul 13, 2005
Messages
6
Programming Experience
Beginner
hi all

i want to know that how can we create a textbox and also a label at runtime
.

thanks
 
Simply create a new instance of the relevant class like you would any other. You then set its properties like Text, Size, Location, etc. and then add it to the parent control by calling <parent control>.Controls.Add. The parent control will most likely be the form itself, but could just as easily be a Panel, GroupBox or some other container.

There is also a help topic dedicated to this subject. Do a help search for "control runtime" for more information.
 
Back
Top