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

Applying color for All forms in Winforms

Manikgisl
HI

can we apply the color for all winforms as skin file as like in Asp.Net

At design time it happen

Is it posible


Thanks

Mani
Dec 5 '08 #1
6 2394
Ramk
61
Go to C:\Program Files\Microsoft Visual Studio 8\Common7\IDE\ProjectTemplates\CSharp\Windows\1033 \WindowsApplication.zip(or to the drive where the VS2005 is located)
and edit the file form1.designer.cs in notepad as below & close it.
After this change, when you create a new windowsapplication, the form will colored with your color.
Expand|Select|Wrap|Line Numbers
  1.  
  2. this.BackColor = System.Drawing.Color.ForestGreen;
  3.  
  4.  
Dec 5 '08 #2
Curtis Rutland
3,256 Expert 2GB
Won't that change every form you create from then on?

I might suggest using Properties.Settings to store your color choices and set the color of the form in the constructor of each form.
Dec 5 '08 #3
Ramk
61
Not at all! Because, we edited the form1.designer.cs, so the changes will effect when a new WindowsApplication is created(By default, Form1 is created with the default WndApp project).
Also, your method works when the application is running if Im not wrong.
I guess, the questioner is interested to change the back color in design time itself.
Dec 6 '08 #4
Curtis Rutland
3,256 Expert 2GB
Right, you are suggesting changing the default template? That can be quite useful, as long as you change it back when you don't want to use that color.
Dec 6 '08 #5
Ramk
61
@insertAlias
You are correct. Infact, I do like to change the default templates to suite my requirements which could speed up the developement.
Dec 6 '08 #6
balabaster
797 Expert 512MB
I'd create a static class that contains a public property that sets the color. In every one of my forms in the Form's Load event I'd set it to the value of the property. Or if in VB, I'd do it in a module...

Basically what you're doing is creating a CSS type model. Something like

Expand|Select|Wrap|Line Numbers
  1. Public Static Class MyStyles
  2.  
  3.   Color DefaultFormColor = Color.Red;
  4.  
  5. End Class
Better still, I'd set the color scheme in my config file and have all my forms reference the colors from my config. This way I don't have to recompile to alter my color scheme.
Dec 6 '08 #7

Sign in to post your reply or Sign up for a free account.

Similar topics

6
by: Billy Jacobs | last post by:
I have a website which has both secure and non-secure pages. I want to uses forms authentication. How do I accomplish this? Originally I had my web.config file in the root with Forms...
8
by: STom | last post by:
I have a C# Winforms app that has 5 Winforms, lets say A through E. A: Data entry. When data is entered here in any field, values are updated on forms C, D, E.(Not B) B: Data entry form. When...
1
by: Serdge Kooleman | last post by:
WinForms, how to override/avoide the tab order for a bunch of buttons/textboxes? i have a panel with 4 textboxes (or buttons) in 2 comlumns (so 2 and 2) i would like to scroll in the first...
11
by: Paul Tremblay | last post by:
Hi, I can't seem to locate the visual C++ (pre .NET) ng. This may be slight off topic here - please point me to the correct ng if it is. Without going into much detail (and repeating myself...
20
by: Martin Rosén-Lidholm | last post by:
Although an impossible question to answer, I fell urged to raise it anyhow. Given a fairly complex ERP application scenario, what's your estimation for the X-ratio dev. time for...
1
by: Hal | last post by:
Anyone know of any reference articles to creating a dockable controlbar for WinForms using VB.Net? I am interested in building a floating window that can be docked within the main form of the...
13
by: Bob | last post by:
My WinForms app runs on the single default thread, and uses a single SqlConnection object for all queries. I need to use one or more timers to periodically execute some of them. My own testing...
2
by: Michael D. Ober | last post by:
Is there a way to create a System.Console from code. I periodically have a WinForms app that needs to open a console window for progress tracking. Thanks, Mike Ober.
1
HaLo2FrEeEk
by: HaLo2FrEeEk | last post by:
I need to know how / if it's possible to apply a background color to a ordered list item's numbers, and not the content itself. I've tried: ol { background-color: #FFFF00; } But that...
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:
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
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...
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...

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.