473,222 Members | 1,732 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,222 software developers and data experts.

dynamic winforms UI

Can anyone suggest a best practice approach to building a dynamic
winforms UI.

Just as an example somehting like a billing application where you
enter a customer billing data and the billing options, the UI and the
winform controls you have visible are dynamic and can change as
information is entered, so that there is a dependency between between
the data you enter and how other controls react, and/or are even
selectable

In addtion the UI should be dynamic in that it can vary when it is
first shown. So the problems i imagine with this is the winforms is
built by a designer, and that makes its layout fixed.
So should i look at multiple forms, and show the relevant one only or
is a better approach to build the UI in code and not use the designer
at all.

Does anyone have any info on a best practice approach for this sort of
task or any advice or any tutorials etc.
thanks for any info

Peted
Jun 27 '08 #1
2 5941
"Peted" wrote in message news:5l********************************@4ax.com...
Can anyone suggest a best practice approach to building a dynamic
winforms UI.

Just as an example somehting like a billing application where you
enter a customer billing data and the billing options, the UI and the
winform controls you have visible are dynamic and can change as
information is entered, so that there is a dependency between between
the data you enter and how other controls react, and/or are even
selectable

In addtion the UI should be dynamic in that it can vary when it is
first shown. So the problems i imagine with this is the winforms is
built by a designer, and that makes its layout fixed.
If you look at the designer-generated code, you will find out that the
designer is actually writing code which generates the layout dynamically
when it is executed from the form constructor.
There is nothing to prevent you from writing code like that and
executing it yourself, thereby generating a dynamic layout. For instance, to
add a new textbox to the form you do this:
TextBox t = new TextBox();
t.Top = 200; //Change properties as needed
this.Controls.Add(t);

Basically, whatever you add to the Controls collection of the Form will
appear on screen. Of course, you can also remove elements from the
collection.
Jun 27 '08 #2
On Jun 23, 10:23*pm, Peted wrote:
Can anyone suggest a best practice approach to building a dynamic
winforms UI.

Just as an example somehting like a billing application where you
enter a customer billing data and the billing options, the UI and the
winform controls you have visible are dynamic and can change as
information is entered, so that there is a dependency between between
the data you enter and how other controls react, and/or are even
selectable

In addtion the UI should be dynamic in that it can vary when it is
first shown. So the problems i imagine with this is the winforms is
built by a designer, and that makes its layout fixed.
So should i look at multiple forms, and show the relevant one only or
is a better approach to build the UI in code and not use the designer
at all.

Does anyone have any info on a best practice approach for this sort of
task or any advice or any tutorials etc.

thanks for any info

Peted
You can do the UI as dynamic as you want. You can read the description
from a XML file and create the controls at runtime.
you would need a good framework though to handle the events of such a
form.
We use something similar where all the interface is defined in a XML
file.
Take a look at the Model View Presenter pattern as a way to handle the
user interaction
Jun 27 '08 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

25
by: David Noble | last post by:
We've been developing a web site using 3-tier architecture for 18 months now. There is a common layer that defines the classes - using XML schemas. The data layer acts as a wrapper to 3 databases...
1
by: Will | last post by:
Hi all. I'm learning VB.Net and am developing a WinForms app. I'm trying to make an app that I will use to scan in one or more than on image. I want to use a tabbed interface to hold each image....
6
by: MikeY | last post by:
Hi Everyone, Does anyone know where I can get my hands on a sample with source code of a simple dynamic button control in C# Windows form. I am looking for a sample that uses a class library...
1
by: Wardeaux | last post by:
I'm porting an ASP.NET app to Winforms VB.NET EXE. In ASP.NET I dynamically create an HTML table with variable number rows, cols, and cell contents which includes variable controls (mostly...
2
by: DH | last post by:
Hi All I was wondering if anyone could point me to some good resources on creating dynamic winforms. I would like to allow users to add, position and resize buttons on a winform. Cheers, DH
5
by: brian.wilson4 | last post by:
Our group is currently comparing winforms vs webforms.....app is Corp LAN based - we have control of desktops.....Below is pros and cons list we have come up with - if anything strikes you as...
5
by: matt | last post by:
hello, i am on an interesting project. in this project, i have to create dynamic data-entry forms for offline-users to fill out, save locally, and eventually postback to our app (when back...
8
by: Joergen Bech | last post by:
Suppose I have written a .Net application and - until now - have hardcoded all my text strings. Now, the application needs to be translated into another language. Furthermore, the translation must...
23
by: raylopez99 | last post by:
Here I am learning WinForms and two months into it I learn there's a WPF API that is coming out. Is this WPF out yet, and is it a threat to WinForms, in the sense that all the library routines I...
0
by: veera ravala | last post by:
ServiceNow is a powerful cloud-based platform that offers a wide range of services to help organizations manage their workflows, operations, and IT services more efficiently. At its core, ServiceNow...
0
by: VivesProcSPL | last post by:
Obviously, one of the original purposes of SQL is to make data query processing easy. The language uses many English-like terms and syntax in an effort to make it easy to learn, particularly for...
3
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 3 Jan 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). For other local times, please check World Time Buddy In...
0
by: mar23 | last post by:
Here's the situation. I have a form called frmDiceInventory with subform called subfrmDice. The subform's control source is linked to a query called qryDiceInventory. I've been trying to pick up the...
0
by: abbasky | last post by:
### Vandf component communication method one: data sharing ​ Vandf components can achieve data exchange through data sharing, state sharing, events, and other methods. Vandf's data exchange method...
0
by: fareedcanada | last post by:
Hello I am trying to split number on their count. suppose i have 121314151617 (12cnt) then number should be split like 12,13,14,15,16,17 and if 11314151617 (11cnt) then should be split like...
0
by: stefan129 | last post by:
Hey forum members, I'm exploring options for SSL certificates for multiple domains. Has anyone had experience with multi-domain SSL certificates? Any recommendations on reliable providers or specific...
0
Git
by: egorbl4 | last post by:
Скачал я git, хотел начать настройку, а там вылезло вот это Что это? Что мне с этим делать? ...
1
by: davi5007 | last post by:
Hi, Basically, I am trying to automate a field named TraceabilityNo into a web page from an access form. I've got the serial held in the variable strSearchString. How can I get this into the...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.