473,396 Members | 1,785 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,396 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 5950
"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: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.