Dynamically Load/Save Visual Studio Forms

D

Derek Hart

I want to give my business analysts the ability to create windows forms in
Visual Studio 2008. They will not design any code, but just will design the
screen and set properties. I will use the Visual Studio sdk to build some
other functionality into Visual Studio. I want to be able to save the form
that was created and make it more portable, such as sending to somebody else
to use. I see that 3 files get created: form1.vb, form1.designer.vb and
form1.resx - Is there a way to turn these into xml, or even just use the
form1.vb file only? Can I send this to another PC, and then compile the
application, and have the whole form, or do I need the designer.vb and rex
files also? Could I do a just in time compile and compile the form1.vb form
dynamically the first time it is used in the application?
 
M

Mr. Arnold

Derek Hart said:
I want to give my business analysts the ability to create windows forms in
Visual Studio 2008. They will not design any code, but just will design
the
screen and set properties. I will use the Visual Studio sdk to build some
other functionality into Visual Studio. I want to be able to save the form
that was created and make it more portable, such as sending to somebody
else
to use. I see that 3 files get created: form1.vb, form1.designer.vb and
form1.resx - Is there a way to turn these into xml, or even just use the
form1.vb file only? Can I send this to another PC, and then compile the
application, and have the whole form, or do I need the designer.vb and rex
files also? Could I do a just in time compile and compile the form1.vb
form
dynamically the first time it is used in the application?

A form is just another object. So you can insatiate a new form, put controls
on the form, and address the properties of the form and the controls
dynamically is code, if that's what you're asking.
 
D

Derek Hart

Not exactly what I am looking for. I want to make the form more portable,
and save it to xml, or some format, so it can move between computers and be
used dynamically.
 
M

Mr. Arnold

Derek Hart said:
Not exactly what I am looking for. I want to make the form more portable,
and save it to xml, or some format, so it can move between computers and
be used dynamically.

Well, I worked on an application that was VBA and Access that had all the
information in a database table to basically and dynamically build the form
and place various controls on the form for user input. The application was
converted over to SQL and ASP.net doing the same thing. I don't see why you
couldn't use an XML file for a Windows desktop solution that did something
similar. You would have a blank for in the solution, and you would read the
XML file to build the form.
 
D

Derek Hart

I want to be able to store the form in some portable way. I wonder if I
could use reflection to somehow pull in the form. I don't want to reinvent
the wheel by trying to write out all the info to xml, but I want to to store
the main files that VS.Net builds (such as myForm.vb, myForm.Designer.vb,
myForm.resx). If I send those files to somebody else, I want them to simply
place those files onto their PC, and have .Net be able to dynamically load
the form. The program would obviously know where to look to find the files
for that form. Perhaps the forms could be converted into a separate DLL. Any
ideas?
 
B

Ben Voigt [C++ MVP]

Derek Hart said:
I want to give my business analysts the ability to create windows forms in
Visual Studio 2008. They will not design any code, but just will design
the
screen and set properties. I will use the Visual Studio sdk to build some
other functionality into Visual Studio. I want to be able to save the form
that was created and make it more portable, such as sending to somebody
else
to use. I see that 3 files get created: form1.vb, form1.designer.vb and
form1.resx - Is there a way to turn these into xml, or even just use the
form1.vb file only? Can I send this to another PC, and then compile the
application, and have the whole form, or do I need the designer.vb and rex
files also? Could I do a just in time compile and compile the form1.vb
form
dynamically the first time it is used in the application?

Just use WPF and XAML, they are designed for this. Microsoft even provides
separate tools for developing behavior (Visual Studio) and look+feel
(Expression).
 
D

Derek Hart

If I have a windows forms application as a base, and I make a usercontrol
that loads a XAML form?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top