473,386 Members | 1,706 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.

Controls And Colors

All,

In my Windows based .NET C# application I tried to change
a form's background color to non-gray. The form backround
color change had the desired ripple effect for most
controls on the form however it had no effect, and is a
problem, for:

- a TabControl {not a tabpage - the tabcontrol itself}
- the scroll bars of a Datagrid
- the buttons of a combobox

I got frustrated enough with this problem that I wrote a
recursive loop to set the foreground and background colors
of every control {and their children} to the same color.
The loop worked - except for the controls listed above -
any ideas?

Also, while attempting to beat this problem I tried to be
sneaky and redefine the SystemColors settings for the
form --> only to discover that I can't find an API to
alter the system color pallette at either the application
or, prefereably, the form level. Is there a way to change
the SystemColors pallete on a per form {or at least a per
application} basis?

--Richard

Nov 15 '05 #1
1 3630
Yeah, this type of problems are inherited, they come from Windows OS
controls themselves.... To kind of give you an idea - combobox's button is
not a control (not a window), for example, - this little naughty thing just
gets painted....

Also I'm afraid that API for changing system colors would produce a global
effect - I don't think it works on application level.

Val.

"Richard" <ri******@amgen.com> wrote in message
news:07****************************@phx.gbl...
All,

In my Windows based .NET C# application I tried to change
a form's background color to non-gray. The form backround
color change had the desired ripple effect for most
controls on the form however it had no effect, and is a
problem, for:

- a TabControl {not a tabpage - the tabcontrol itself}
- the scroll bars of a Datagrid
- the buttons of a combobox

I got frustrated enough with this problem that I wrote a
recursive loop to set the foreground and background colors
of every control {and their children} to the same color.
The loop worked - except for the controls listed above -
any ideas?

Also, while attempting to beat this problem I tried to be
sneaky and redefine the SystemColors settings for the
form --> only to discover that I can't find an API to
alter the system color pallette at either the application
or, prefereably, the form level. Is there a way to change
the SystemColors pallete on a per form {or at least a per
application} basis?

--Richard

Nov 15 '05 #2

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

Similar topics

2
by: Bodger | last post by:
I have been working in PHP off and on for a few years and like the language. I have been reading a little about frameworks and web controls and what not. I am interested in a more desktop...
3
by: Marco Simone | last post by:
Hi, I have form with few rows of text boxes and labels. I tried to change colors of labels, when txtBox gets focus, with code. Private Sub txtBox1Row1_GotFocus() Me!lblData1.BackColor =...
16
by: TD | last post by:
This is the code under a command button - Dim ctl As Control For Each ctl In Me.Controls If ctl.BackColor <> RGB(255, 255, 255) Then ctl.BackColor = RGB(255, 255, 255) End If Next ctl
3
by: Steve Koon | last post by:
Any thoughts on getting this project to work or suggesting another method would be appreciated. Steve ========================================== Project: A Windows Form which acts as a...
5
by: Amelyan | last post by:
How can I get state of dynamically created controls (RadioButton, CheckBox, TextBox.Text) on post back when I click submit button? The only way I know is by traversing Response.Form enumberator;...
0
by: WhiteWizard | last post by:
Here’s the situation: I am writing a C# Windows application using VS 2003. I have built a user control, and it has a Tab Control on it with (currently) 2 tab pages, and the whole thing sits...
15
by: Arpan | last post by:
Consider the following code which retrieves data from a SQL Server 2005 DB table & displays it in a DataGrid: <script runat="server"> Sub Page_Load(ByVal obj As Object, ByVal ea As EventArgs)...
4
by: RamanS | last post by:
Hi, I have a form with 10 labels named (label1 to Label10). Is there a way where i can loop through these controls and set their background colors using vba? It very lengthy to write 10 lines...
7
by: Brian | last post by:
Hi, here is exactly what I want to try and do. On a simple level, when the user clicks on a textbox the matching label will change colors to hightlight the which field they are editing. By...
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
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...
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
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.