473,378 Members | 1,319 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,378 software developers and data experts.

dynamic user interface (win app)

I want to enable the user to define parts of their user interface. I
am developing an application that does some accounting functions
(basicly the end user enters revenues for each account, and users will
frequently enter data in several accounts that I want visible based
upon the company).

Anyways, not that the brief description I just gave you will help, but
any ideas on how to dynamicly populate controls on a winform?? What
would be the winform equivilent of the ASP.NET repeater control? Or
am I on the wrong track?

Thanks,

-RL
Jul 21 '05 #1
4 1610
Roy,

I use a dataset the retrieves data from a db to dynamically build controls
on a winform. You could also use XML to do it. If you want to see an
example just respond back and I will email it to you or post the code on
here.

Good Luck

"Roy Lawson" <ro*@xeon.tv> wrote in message
news:c4*************************@posting.google.co m...
I want to enable the user to define parts of their user interface. I
am developing an application that does some accounting functions
(basicly the end user enters revenues for each account, and users will
frequently enter data in several accounts that I want visible based
upon the company).

Anyways, not that the brief description I just gave you will help, but
any ideas on how to dynamicly populate controls on a winform?? What
would be the winform equivilent of the ASP.NET repeater control? Or
am I on the wrong track?

Thanks,

-RL

Jul 21 '05 #2
Hi all,

I am interested like to see the example. Could you post
the code here.

Thanks

Simon
-----Original Message-----
Roy,

I use a dataset the retrieves data from a db to dynamically build controlson a winform. You could also use XML to do it. If you want to see anexample just respond back and I will email it to you or post the code onhere.

Good Luck

"Roy Lawson" <ro*@xeon.tv> wrote in message
news:c4*************************@posting.google.c om...
I want to enable the user to define parts of their user interface. I am developing an application that does some accounting functions (basicly the end user enters revenues for each account, and users will frequently enter data in several accounts that I want visible based upon the company).

Anyways, not that the brief description I just gave you will help, but any ideas on how to dynamicly populate controls on a winform?? What would be the winform equivilent of the ASP.NET repeater control? Or am I on the wrong track?

Thanks,

-RL

.

Jul 21 '05 #3
Hello,

Thanks for your post. As I understand, you want to dynamically add controls
to WinForms. Please correct me if there is any misunderstanding. The Form
class in WinForm includes a control collection representing a collection
of controls on the form. We just need to create a control (say, button,
etc) and then add it to Form.ControlCollection. I believe the following
articles/samples are helpful:

Form.ControlCollection Class
http://msdn.microsoft.com/library/de...us/cpref/html/
frlrfsystemwindowsformsformcontrolcollectionclasst opic.asp?frame=true

Adding a control to a form programmatically
http://www.developersdex.com/gurus/articles/62.asp

Please feel free to let me know if you have any problems or concerns.

Regards,

HuangTM
Microsoft Online Partner Support
MCSE/MCSD

Get Secure! -- www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.

Jul 21 '05 #4
Here is some code to create a dynamic control:
string controlType = System.Windows.Forms.Label or
System.Windows.Forms.TextBox...

Assembly assem = Assembly.GetAssembly(typeof(Form));
Type t = assem.GetType(controlType);
object obj = Activator.CreateInstance(t);
Control tb = (Control)obj;
this.Controls.Add(tb);

All of my data is stored in a db table and based on user input the app
retrieves the data to create the controls. It just loops through each row
retrieved. In a web app, I have used an XML file to create dynamic controls
using the same approach except for writing some code to extract the data
from the xml file.

I also have seen another approachs where you create component class with a
Factory Class, IControl interface, and Control Classes. I like the approach
above better because it gives you better control over creating the control.
Especially if you need to add event handlers and so on.

Hope this helps out.

"Roy Lawson" <ro*@xeon.tv> wrote in message
news:c4*************************@posting.google.co m...
I want to enable the user to define parts of their user interface. I
am developing an application that does some accounting functions
(basicly the end user enters revenues for each account, and users will
frequently enter data in several accounts that I want visible based
upon the company).

Anyways, not that the brief description I just gave you will help, but
any ideas on how to dynamicly populate controls on a winform?? What
would be the winform equivilent of the ASP.NET repeater control? Or
am I on the wrong track?

Thanks,

-RL

Jul 21 '05 #5

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

Similar topics

0
by: Eric | last post by:
Hello, I'm completely new to c# and the .NET Framework, so perhaps there is an obvious answer to this. But I have done searches in MSDN and news groups and not found anything that really...
3
by: zlst | last post by:
Many technological innovations rely upon User Interface Design to elevate their technical complexity to a usable product. Technology alone may not win user acceptance and subsequent marketability....
3
by: dhnriverside | last post by:
Hi guys I'm writing a console app in C# for which i want to enable the user to have several "plug-ins". The app has a switch to set the plug-in to use, and at runtime the required dll is loaded...
8
by: George Meng | last post by:
I got a tough question: The backgroud for this question is: I want to design an application works like a engine. After release, we can still customize a form by adding a button, and source code...
4
by: Roy Lawson | last post by:
I want to enable the user to define parts of their user interface. I am developing an application that does some accounting functions (basicly the end user enters revenues for each account, and...
24
by: Rob R. Ainscough | last post by:
VS 2005 I have: ClickOnce deployment User's that hate and or don't want to use an IE Client (don't blame them) I don't see how ASPX web pages are going to survive? With .NET 2.0 and clickonce...
2
by: Luis Arvayo | last post by:
Hi, In c#, I need to dynamically create types at runtime that will consist of the following: - inherits from a given interface - will have a constructor with an int argument
10
by: viashino | last post by:
Hi, I have written a Console Application that is doing different things, like checking the status of different network Hosts. I would like to implement a WebInterface to show such status, and...
2
by: Paul Hadfield | last post by:
Hi, I'm not having a lot of luck googling for this one, I want to be able to store a custom class in the user settings (DotNet2.0, win app). I don't wish to create public get / set properities...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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: 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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.