GUI definition in external file

O

onno.willems

Hi,

A little part of my (.NET 2.0) WinForm GUI need to be configurable by
a user. The user can specify a variable number of items which should
appear on a form like this:
<Label> <Label> <ComboBox>
<Label> <Label> <ComboBox>
<Label> <Label> <TextBox>
<Label> <Label> <CheckBox>
etc
I want to store the (user changeable) definition for this in an
external XML file. My 1st thought was reading the XML file and filling
a DataGridView, but you can't seem to mix Edit/Text/Checkboxes in a
single grid because you set the type by column. Ow well, I think I can
generate the GUI dynamically placing the controls in a panel with
AutoScroll set to True.

But the user needs to be able to add a little dynamic behavior too.
For example, if combobox1 has value "SomeValue1" and CheckBox2 is
checked, TextBox1 should be disabled.

Any thoughts on how I can achieve this?

Thanks,
Onno
 
G

Guest

(e-mail address removed) wrote in (e-mail address removed):
A little part of my (.NET 2.0) WinForm GUI need to be configurable by
a user. The user can specify a variable number of items which should
appear on a form like this:
<Label> <Label> <ComboBox>
<Label> <Label> <ComboBox>
<Label> <Label> <TextBox>
<Label> <Label> <CheckBox>
etc
I want to store the (user changeable) definition for this in an
external XML file. My 1st thought was reading the XML file and filling
a DataGridView, but you can't seem to mix Edit/Text/Checkboxes in a
single grid because you set the type by column. Ow well, I think I can
generate the GUI dynamically placing the controls in a panel with
AutoScroll set to True.

But the user needs to be able to add a little dynamic behavior too.
For example, if combobox1 has value "SomeValue1" and CheckBox2 is
checked, TextBox1 should be disabled.

Any thoughts on how I can achieve this?

We built a GUI editor (leveraged the built in .NET Windows Form Editor
APIs) which serializes windows forms into XML. The forms are then
deserialized on the client and loaded up.

If you want to save yourself hooking into the lower level apis, you can
purchase Form Designer from Greatis:

http://www.greatis.com/dotnet/formdes/
 
O

Onno

If you want to save yourself hooking into the lower level apis, you can
purchase Form Designer from Greatis:

Thanks. Unfortunately, we are not allowed to buy tools/components from
other manufacturers in this project.
 
G

Guest

Thanks. Unfortunately, we are not allowed to buy tools/components from
other manufacturers in this project.


In that case you'll have to build it yourself... but I must warn you it'll
take a significant more amount of development.

It's doable (we built quite a nice editor) but it wasn't easy!
 
F

Family Tree Mike

Onno said:
Thanks. Unfortunately, we are not allowed to buy tools/components from
other manufacturers in this project.

Given that, then have you considered just letting them extend one of your
dialogs and code it with the express version? Your config file could specify
a class name and load the dialog by name. It's not an integrated product,
but it sounds like you are expecting a certain level of programming knowledge
by your user base. This could be satisfactory to your customers.
 
T

Tom Shelton

Hi,

A little part of my (.NET 2.0) WinForm GUI need to be configurable by
a user. The user can specify a variable number of items which should
appear on a form like this:
<Label> <Label> <ComboBox>
<Label> <Label> <ComboBox>
<Label> <Label> <TextBox>
<Label> <Label> <CheckBox>
etc
I want to store the (user changeable) definition for this in an
external XML file. My 1st thought was reading the XML file and filling
a DataGridView, but you can't seem to mix Edit/Text/Checkboxes in a
single grid because you set the type by column. Ow well, I think I can
generate the GUI dynamically placing the controls in a panel with
AutoScroll set to True.

But the user needs to be able to add a little dynamic behavior too.
For example, if combobox1 has value "SomeValue1" and CheckBox2 is
checked, TextBox1 should be disabled.

Any thoughts on how I can achieve this?

Thanks,
Onno

Hmmm... maybe using xaml and wpf? I haven't played a lot with the
loading of external xaml, but it should be doable. I think you may
even be able to do some of the stuff your trying to do using xaml
databinding and triggers....
 
G

Guest

=?Utf-8?B?RmFtaWx5IFRyZWUgTWlrZQ==?=
Given that, then have you considered just letting them extend one of
your dialogs and code it with the express version? Your config file
could specify a class name and load the dialog by name. It's not an
integrated product, but it sounds like you are expecting a certain
level of programming knowledge by your user base. This could be
satisfactory to your customers.

Further extending this idea, you could build a plug-in system - that is
much simplier than implementing a full GUI editor.

A plug-in system would allow external developers to build dialogs that
reside in DLLs. The DLLs would then be loaded up by your applications to
display the appropriate screen.

This approach will require programming knowledge to design and build the
DLLs.
 
O

Onno

Given that, then have you considered just letting them extend one of your
dialogs and code it with the express version?  
That would be a bit overkill I think. The only thing that I need is
that an administrator kinda guy can define some variables. This guy
works with XML, but is not a hard core programmer. I was thinking of
creating some XML structure like this:
<Variables>
<Var name="var1">
<Description>Description goes here</Description>
<Type>EditBox</Type>
</Var>

<Var name="var2">
<Description>Description goes here</Description>
<Type>DropDown</Type>
<AllowedValues>
<AllowedValue>Option1</AllowedValue>
<AllowedValue>Option2</AllowedValue>
</AllowedValues>
</Var>
</Variables>
That's about all we need for the static part. But it would be nice if
we could add some logic, like "when var2="Option1" disable var1.
 
O

Onno

Hmmm...  maybe using xaml and wpf?  I haven't played a lot with the
loading of external xaml, but it should be doable.  I think you may
even be able to do some of the stuff your trying to do using xaml
databinding and triggers....
Thanks! But wpf is not part of .NET 2.0 (or can it be done?) And can
you mix wpf with a WinForm app (have one part of a form be filled in
by WPF?)

Regards,
Onno
 

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