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

Sharing .net controls?

Is it possible to share controls, ie a label or a textbox, amoung Group
Boxes?

I have some statistics info that I display on a couple of different
forms and it would be nice to be able to maintin one control rather
than multple controls.

Thanks

Jul 21 '05 #1
1 1159
First, no it's not possible. A control can have only one parent
container, and one location within that container.

That said, the secret is to share the code that maintains the controls,
not share the controls themselves. A lot of people using Microsoft's
(.NET) DataBinding classes to connect controls to sources of data. I
can't stand them, personally (I think that they have enough problems
that they're more trouble than they're worth). However, they're not the
only game in town.

Read up on the Java pattern "Model-View-Controller" for an idea of how
to separate the logic that provides the data from the screen controls
themselves. Implementing a complete MVC architecture is maybe a bit
more than you need, but the basic concepts should apply.

As well, if you read up on MS's DataBindings, the ideas behind them may
be very helpful, too, even if you don't use DataBindings. Myself, I
wrote my own bindings, and writing screens is a breeze now.

Jul 21 '05 #2

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

Similar topics

3
by: Robert W. | last post by:
I'm embarking on a project that will have both a desktop application and a Pocket PC application. It seems logical to have as much code as possible sitting in a shared project, which would be...
1
by: Vlade | last post by:
I have built a asp.net web project with site wide user controls. These controls will be used as the top and bottom of every page we make. I have the project (which is basically 1 vb class file,...
3
by: Shikari Shambu | last post by:
Hi All, I have a situation where multiple applications are sharing some pages/ controls. So, I have a separate common project that has the common pages/ controls. My question is how do I...
2
by: Ajeet YS | last post by:
Hello, We need to share the same user controls among many developers in the same project. How do we achieve this? We have looked into using Custom controls, but they have a very high development...
2
by: axis | last post by:
I have two custom controls on a page that work on the same object that needs some prepping when first loaded. Currently I just load them in both controls individually, essentially doing the same...
5
by: scorpion53061 | last post by:
I am trying to be able to share a groupbox and its related controls among all of my tab pages. This does not error but the controls do not appear either. Thank you for your help!! ...
2
by: Chris Fink | last post by:
What is the recommendation for sharing master pages across IIS Servers? In our corporation, we have many webservers in different environments (intranet, extranet, etc). I've done some searching,...
1
by: Joe | last post by:
While I understand that Server Side Includes still work, I realize it's not the best practice for sharing code such as a common set of includes between screens. In ASP.NET I've already built...
4
by: Mike P2 | last post by:
Hi. I'm writing controls that have to query the database, and it bothers me that I might have several of these controls on a page that each create, open, and close their own connection with the...
8
by: Nathan Sokalski | last post by:
I have a form that contains a number of fields, all of which have validators. There are two submit buttons, one to update a record and one to add a record. Because the only difference in validation...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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
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...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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...
0
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...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.