Dynamic Control Generation

MTSkull

Well-known member
Joined
Mar 25, 2003
Messages
135
Location
Boulder, Colorado
How would I generate Dynamic Controls?

What I want to do is have the user Click a button, which will read in all the emails from an Outlook folder, then they can click a corresponding option button saying whether it is a good or bad email.

It should look kind of like this (use your imagination)

Label.text (email 1 subject), Pass Option, Fail Option
Label.text (email 2 subject), Pass Option, Fail Option
etc...

If the number of emails exceeds the screen space then scroll bars are generated.

I do not need specific code, just pseudo code so I know how to get started.

Thanks
MTS
 
Creating new controls is easy, just do something like this:

For each letter
Dim lbl As New Label()
Set the labels positions (based on the message #) and size
Set the labels text
Me.Controls.Add(lbl)
Next

If you want scrollbars to be added automatically, create a Panel control (at design-time)
and set its AutoScroll property to True. Then just add each Label to your Panels
Controls collection, and if theyre "out of bounds" of the labels boundaries, the user
can scroll.
 
Back
Top