المساعد الشخصي الرقمي

مشاهدة النسخة كاملة : Dynamic Form Creation/Layout



C# Programming
02-13-2013, 04:51 AM
I've had a personal project in mind lately. Part of it will include user-created fields/field types. Think of it as an inventory control system. Each object will have common properties but I want the user to be allowed to create so many custom fields for each item type. As far as storing the custom fields, I know how I will achieve that aspect of it.

What I would like to know is how I should go about generating a dynamic view for those custom fields. I considered a "table" (DataGridView) at first. But I decided I would like to go with something more user friendly. It doesn't necessarily need to be a user-defined layout. But how can I present it in such a way that it's a Label control and then a TextBox control? My thought on it so far is to possibly use a TableLayoutPanel and add the controls for each custom field as necessary. Would this be an efficient solution or is there a cleaner solution?

If something like a TableLayoutPanel is the right tool for this, that's fine. I don't mind going that route. I just wanted to get some feedback from others before I continue.

I'm using VS2010 and C# 4.0.

Thanks a bunch! http://www.barakasoft.com/script/Forums/Images/smiley_smile.gif
djj55: Nice but may have a permission problem
Pete O'Hanlon: He has my permission to run it.