|
|
|||||||||
|
|||||||||
|
|||||||||
| |
||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Article Discussion: Dynamically Adding Controls to a Windows Form
For a simple and effective solution to writing an application that can be used by several different clients, look into Skousen's article here on defining attributes needed to create a form dynamically. He reduces the need to compile and to take extra Tylenol.
Read the full article here: Dynamically Adding Controls to a Windows Form |
|
#2
|
|||
|
|||
|
Hi Daniel
I read your article with great interest because I need to do the same for my app so it was very helpful. A further requirement I have is to serialize the form (including all its dynamically created controls). The idea being that an Administrator will create a dynamic form, serialize it and then all clients can then reference that "dynamic" form without having to do the dynamic generation themselves. Is this possible - or is there too much work involved. As far as I know the 'container' form would have to implement the ISerializable interface and any control I have on the form (i.e. textbox, button, comboBox) would have to override their parents and implement the ISerializable interface. All properties of those controls would then have to be added to the SerializationInfo object in the GetObjectData method. Have you serialized any dynamic forms or is it not feasible ? thanks for any help /Ronan |
|
#3
|
|||
|
|||
|
Sorry about the delay, Ronan. Had some problems with my user account and it took me a bit to get back into the forums properly.
Your idea is a good one, and I don't see any flaws in your design. Another thought is to allow for the dynamic creation of forms as defined by an administrator by passing around the xml defining what you want to appear. Admittedly this is much more complicated than the sample article I wrote (which dealt more with what data will appear). We don't seem to be alone in our thoughts. Microsoft's Longhorn is looking at creating a language called XAML that uses XML to define your forms / webpages. So if we wait around just a little longer... ![]() I'm going to start poking around and try to make a program that will do something along the lines of reading an XML file and creating an entire form dynamically at run time. I'll post my results once I'm done, although with some other stuff on my plate this might be several months out. Perhaps you could also let us know what kind of solution you come up with? Thanks for reading, and I'll catch you later. |
![]() |
| Viewing: ASP Free Forums > Other > Development Articles > Article Discussion: Dynamically Adding Controls to a Windows Form |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|