How I can creat Label in visual basic without drag drop in design?

EX:

If I enter 5 in the Textbox, and click button

result will apear 5 Labeles in the form.

Member Avatar for Unhnd_Exception
dim l as label
for i = 1 to 5

   l = new label
   'change any settings

   'add it to the form or another control
   me.controls.add(l)
next

How i can add Label to the panel??

dim l as label
for i = 1 to 5

   l = new label
   'change any settings

   'add it to the form or another control
   me.controls.add(l)
next

How i can add label in the panel?

then you would use panelname instead of me in the code above.

panel1.controls.add(label)

then you would use panelname instead of me in the code above.

panel1.controls.add(label)

Tanks alot

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.