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

Winform Style Sheets?

Hi all,

Is there a way to change the properties of certain controls on all forms
that a control exists on?

For instance, say I have 10 forms in a solution, and each has a datagrid. I
want to change the backgroundcolor of a datgrid and want this change to take
place on all the datagrids in the solution, is there a way to change it once,
and have it cascade to all the other datagrids?? Similar to a style sheet
with web pages...
Or do I have to change each one manually?

Thanks in advance,

--
Kevin
Jul 21 '05 #1
1 2918
WinForms offers visual inheritance which will allow you to accomplish what
you're looking for. I typically create a base application form, let's call
it AppBaseForm, that other forms in my application derive from. This allows
me to control, in one location, a standard application icon, for example.

You can derive other forms from your base form as well- so if your
accounting department, for example, has a custom look and feel or graphic you
could inherit from AppBaseForm and create another base form called
AcctBaseForm that all accounting screens could inherit from.

..Net is an extensible framework. You can be more granular than the form
level and derive from the DataGrid control and extend it (ie, customize
colors) by creating a custom user control that extends the datagrid by
inheriting from it and customizing it. This allows you to add your custom
control onto one or many forms and control behaviour in a single location.

JP

"ksedran" wrote:
Hi all,

Is there a way to change the properties of certain controls on all forms
that a control exists on?

For instance, say I have 10 forms in a solution, and each has a datagrid. I
want to change the backgroundcolor of a datgrid and want this change to take
place on all the datagrids in the solution, is there a way to change it once,
and have it cascade to all the other datagrids?? Similar to a style sheet
with web pages...
Or do I have to change each one manually?

Thanks in advance,

--
Kevin

Jul 21 '05 #2

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

Similar topics

16
by: Geoff Cox | last post by:
Hello, I publish some web pages using large fonts and would like to give the user the opportunity to print the pages using a smaller font. I believe that this is possible using different style...
3
by: Phil Thompson | last post by:
does it matter in which order i place different style sheets i.e. <link rel="stylesheet" type="text/css" media="screen" href="style/screen.css" /> <link rel="stylesheet" type="text/css"...
12
by: relaxedrob | last post by:
Hi All! I have a page with with the following style information: <link rel="stylesheet" type="text/css" href="/eEmployment/eTech.css" /> <style type="text/css"> DIV.Application {...
1
by: ksedran | last post by:
Hi all, Is there a way to change the properties of certain controls on all forms that a control exists on? For instance, say I have 10 forms in a solution, and each has a datagrid. I want to...
12
by: Jarno Suni | last post by:
I want a device to use styles given for media type handheld and not the styles given for media type screen, if the device supports media types handheld and screen. Is it possible without writing...
9
by: Radium | last post by:
Cascading Style Sheet is an extreme hazard to your privacy. It allows others on the internet to see your monitor and files. It allows them to copy images on your monitor to their computers. It...
2
by: Hallvard B Furuseth | last post by:
Are there any guidelines or conventions for how to organize the preferred and alternate style sheets for a site, sheets for different media, and what titles to give them in the <link...
1
by: mscertified | last post by:
Can anyone explain how references to style sheets work, I've exhausted looking in help, its all so confusing. I have three style sheets in my project under 'Style Sheets'. Only the first style...
5
by: =?Utf-8?B?SmVycnkgQw==?= | last post by:
I have a machine running IIS 6.0. I just replaced the web.config and several aspx pages in the application and now the style sheets are not working. the images from the themes work but not the css...
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: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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?
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
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
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.