473,785 Members | 2,777 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 5959
"Peted" wrote in message news:5l******** *************** *********@4ax.c om...
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.A dd(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
5627
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 - SQL Server, Oracle and AS400. The business layer exposes web services which communicate with the front end, ASP.Net. All 3 tiers are on different boxes. This works well. Now I am leading a team to build a winforms app. I need some advice as
1
6323
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. Here's the code I'm using for testing purposes. I've got the code in the form's load event, but I think I'd have the same problems no matter where the code existed. Right now, the form has an empty tab control, everthing else is dynamic. <code>
6
2924
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 that sets the properties send/passed from the main windows form. I'm having problems with the class library, the button control collection and my referencing it ie this.Control.Add(aControl);. Any and all help is appreciated. Thanks in advance.
1
4546
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 dropdownlist and buttons) all depending on certain input. I need to create a similar table/grid in Winforms, what's the best approach. (I've looked at datagrid before and it doesn't allow me to do some of the things I need) Any suggestions?? MTIA...
2
2995
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
3829
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 untrue or you would like to add - please comment - thanks..... Rich Client PROS 1. User experience (* indicates feasible on web with AJAX) - a. Single, unified application experience b. Windows/Office-like look and feel - i.Tabs - drag and drop...
5
2543
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 online). data validation is required on the form. i had looked at using PDF-forms for this.. Adobe's "LifeCyle Forms" would work perfectly. with it one can pass in xml to their webservice & get back PDF-form binaries. however, Adobe's pricing is...
8
3061
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 be done by someone at the other end of the world, without access to Visual Studio. I suppose the first thing to do would be to make sure that all strings are loaded from resource files, but what about the language editor and language switching?
23
4561
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 memorize and/ or familiarize myself in WinForms will disappear in WPF? I did note in one early version of C#, the non-generic "ArrayList" was replaced by the generic and template <based List, but that kind of change is not a big deal. If WPF...
0
9645
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9480
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10327
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10092
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9950
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6740
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
4053
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3647
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2879
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.