PC Review Forums Newsgroups Microsoft DotNet Microsoft Dot NET Framework Forms ~~ Creating Dynamic Controls in Windows Forms

Reply

~~ Creating Dynamic Controls in Windows Forms

 
Thread Tools Rate Thread
Old 29-03-2004, 05:51 PM   #1
c#wonder
Guest
 
Posts: n/a
Default ~~ Creating Dynamic Controls in Windows Forms


Hello,

I'm buildig an application that wil allow users to create their own
forms.


In the form builder the aim is to allow them to pick from 3 ro 4
predefined types of windows controls ( i.e. text box, list box e.t.c. )

I believe the easist way would be to create 4 custom controls that will
"package" a label and the control in one, so when they select a control,
the label will automatically be set as well.

If I could get some help as to adding these custom controls on the fly to
a form, and later adding them to group Boxes ( and allow unlimited
nesting )

I need to track what was added to save to a database ( the database and
objects are already defined but I'll need some sort of collection on the
UI to track what they're adding )

and somehow control the formatting.. it would be much appreciated!

Thanks


  Reply With Quote
Old 29-03-2004, 06:01 PM   #2
Lloyd Sheen
Guest
 
Posts: n/a
Default Re: ~~ Creating Dynamic Controls in Windows Forms

A method of getting the code is to create a form using the desginer. Place
the controls in the form the way you want the user to be able to create the
form. Then you can browse the code generated by the designer and use that
as a template for adding the controls.

Lloyd Sheen

"c#wonder" <me@home.ca> wrote in message
news:luY9c.43758$li5.21425@pd7tw3no...
> Hello,
>
> I'm buildig an application that wil allow users to create their own
> forms.
>
>
> In the form builder the aim is to allow them to pick from 3 ro 4
> predefined types of windows controls ( i.e. text box, list box e.t.c. )
>
> I believe the easist way would be to create 4 custom controls that will
> "package" a label and the control in one, so when they select a control,
> the label will automatically be set as well.
>
> If I could get some help as to adding these custom controls on the fly to
> a form, and later adding them to group Boxes ( and allow unlimited
> nesting )
>
> I need to track what was added to save to a database ( the database and
> objects are already defined but I'll need some sort of collection on the
> UI to track what they're adding )
>
> and somehow control the formatting.. it would be much appreciated!
>
> Thanks
>
>



  Reply With Quote
Reply



Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off