Creating Windows Form in run time for client applications

Hi...

I'm developing a desktop application and I need create some Window Form in run time according to database's data.
I mean, if a product property include expired date, weight, name and color. Then the form in the client to fill this product kind would be a date control (for a expired date), a scale control (for a product weight), a text control (for a product name) and a color palette control (for a product color).

How to build a application like that

Thanks for all.





Answer this question

Creating Windows Form in run time for client applications

  • Astek djacquet

    Hi, araujo.guntin

    Do you mean to create a window form to display the information about a certain product You can try in this way, create a form  when designing, add these controls: DateTimePicker( for expired date ), NumericUpDown( for product  weight ), and a textbox, ColorDialog to it, and whenever need to show this form, use a statement like:

    Form1 form1 = new Form1();

    form1.ProductID = ...

    form1.show();

    to show this form, where the ProductID on the Form1 is a variable defined for identifying product, using this ID to load product information from database.

    Regards,and hope for more information from you,

    Ye



  • Creating Windows Form in run time for client applications