Is there an easy was to create controls at runtime with VB? Right now I've
got 15 labels on my form that resize programatically. While this is working
it was a quick solution and I cannot get it out of my head how ridiculous
this is from a development standpoint.

Any suggestions? My application mimics a to-do list if you need to picture
it. Step 1 has 85 characters so make the textbox this high and change the
y-position of label 2 to the y-position of label 1 plus 85 & add 5 more
pixels for a gap. This is also how I manipulate the positioning of the
checkboxes & dynamically size the panel & the vertical scrollbar.

TIA - Nick

Re: Creating Controls at RunTime by Chris

Chris
Wed Aug 24 17:06:20 CDT 2005

All controls are created at runtime. The designer simply writes the code
for you, and that code can be a good reference. Open the
InitializeComponent method and see how it does it, then follow the same
pattern.

--
Chris Tacke
Co-founder
OpenNETCF.org
Are you using the SDF? Let's do a case study.
Email us at d c s @ o p e n n e t c f . c o m
http://www.opennetcf.org/donate


"Nick Stineman" <NickStineman@discussions.microsoft.com> wrote in message
news:24AA87E4-B595-40EA-9ABB-EEE8E13EEFC8@microsoft.com...
> Is there an easy was to create controls at runtime with VB? Right now
> I've
> got 15 labels on my form that resize programatically. While this is
> working
> it was a quick solution and I cannot get it out of my head how ridiculous
> this is from a development standpoint.
>
> Any suggestions? My application mimics a to-do list if you need to
> picture
> it. Step 1 has 85 characters so make the textbox this high and change the
> y-position of label 2 to the y-position of label 1 plus 85 & add 5 more
> pixels for a gap. This is also how I manipulate the positioning of the
> checkboxes & dynamically size the panel & the vertical scrollbar.
>
> TIA - Nick



Re: Creating Controls at RunTime by Daniel

Daniel
Fri Sep 09 15:16:36 CDT 2005

If I understand your question.. of course you can, what have you tried?

When you drag controls on the design surface of the form, code is generated
for you in the InitializeComponent method; go there and look at the code to
see how it is done (new control, location, size, add to form.controls etc)

If you are still having trouble post the code you tried...

Cheers
Daniel
--
http://www.danielmoth.com/Blog/

"Nick Stineman" <NickStineman@discussions.microsoft.com> wrote in message
news:24AA87E4-B595-40EA-9ABB-EEE8E13EEFC8@microsoft.com...
> Is there an easy was to create controls at runtime with VB? Right now
> I've
> got 15 labels on my form that resize programatically. While this is
> working
> it was a quick solution and I cannot get it out of my head how ridiculous
> this is from a development standpoint.
>
> Any suggestions? My application mimics a to-do list if you need to
> picture
> it. Step 1 has 85 characters so make the textbox this high and change the
> y-position of label 2 to the y-position of label 1 plus 85 & add 5 more
> pixels for a gap. This is also how I manipulate the positioning of the
> checkboxes & dynamically size the panel & the vertical scrollbar.
>
> TIA - Nick