systemcolors

Getting Windows XP colours in .NET

I am trying to get a specific colour used by Windows XP in my .NET application. In Windows XP, if you go the Control Panel in 'category view', on the left hand side you have some 'See Also' options (Windows Update, Help and Support, Other Control Panel Options). The colour I'm trying to get is the light blue background colour shown beh...

Remove system colors from TcxDBColorCombobox

I have a TcxDBColorCombobox and I want the drop down to not include the system colors like clBtnFace, so it only includes colors like clRed. Additionally I would like it to include clWindow and clWindowText, but I can add those as custom colors if necessary. The process should be the same as for TcxColorCombobox. I am sure I will figu...

.NET: How to get ActiveCaptionText color when window is maximized?

How do you get the ActiveCaptionText color when a window is maximized? The color is correct when the window is restored: But is the wrong color when the window is maximized: How do you get the active ActionCaptionText? Note: Same question for ActiveCaption, InactiveCaption and InactiveCaptionText. It seems like there should be...

Changing system colors for a single application (Windows, .NET)

I know I should generally avoid messing up with such system settings, but my application do already use nonstandard colors and I have no influence on that. I would like to be able to add standard .NET controls in some places, but their colors do not match. I would like to have a hack that would replace system colors for this one applicat...

Matching windows system colors: light on dark

I'm trying to make my app a good Windows citizen, so I use matching system colors (see "When selecting system colors, match but don't mix") as much as possible. However, sometimes light text on a dark background (something like COLOR_APPWORKSPACE/clAppWorkSpace) seems most appropriate, but the system doesn't provide this. Do you have any...

Matching background color for COLOR_GRAYTEXT

(Related question to "Matching windows system colors: light on dark".) There doesn't seem to be an "official" background color for COLOR_GRAYTEXT. This looks strange to me. Do you know any? ...

ComponentResourceKey as DynamicResource problem

Hi, I'm seeing some unexpected behavior using ComponentResourceKey. The problem came up because I was using names used in the SystemColors class. Consider the following code: First I expose a ComponentResourceKey in a as a static property: public enum ColorKeys { ControlColor } public class MyColors { public static Compon...

Is it possible to use theme colors in Windows Forms apps?

I normally make use of System Colors whenever possible when designing Windows Forms applications just so that it'll fit in with the user's preferences. But is it possible to use Theme Colors? I realize that this limits you in several ways (must be running Windows that supports it and has the Themes service running), so I would certainl...

Visual guide to System.Windows.SystemColors

All throughout the Windows UX Guide it is suggested to use the appropriet SystemColors within an application to ensure that an application's default theme is consistent with teh rest of the system. I totally aggree, the only problem is that there seems to be no guide for how named values within the SystemColors type map to actual common ...

Can I get the RGB of a system color in C# without using pinvoke?

I want to determine the RGB color of a system color such as SystemColors.HotTrack. Is there a way to do this without resorting to using P/Invoke and GetSysColor (not including drawing into a bitmap and checking pixel values)? ...

WPF global Controls color changes

Hi ! Suppose you want to override the Background / Foreground / TextSelection ... Colors for your WPF Controls. In my opinion, you need 2 things: Override the SystemColors in your Resources files Override the ControlTemplates (by adding additional Triggers etc.) The reason for this is, that some Controls in .NET 3.5 don't all...

WPF generic colors based on SystemColors

I need to have some generic colors in my application, which are based on the system colors, which change based on the active theme. So I believe I need some IValueConverters that each return a brush when given a system color brush. But where do I put the logic? As I see it I might have 2 options. Option 1) place SolidColorBrush(es) in ...

WPF resource not found

If I use the following in XAML I get an error: <Style TargetType="TreeViewItem"> <Style.Triggers> <DataTrigger Binding="{Binding Selected}" Value="True"> <Setter Property="Background" Value="{DynamicResource {x:Static SystemColors.HighlightColor}}"/> </DataTrigger> </Style.Trig...

Reset TextBox.Background to default in WPF so it still gets updated when system settings change

I have a TextBox that I wish to reset its Background property to its default value after changing it to a different colour. I have tried setting it to SystemColors.WindowBrush, but then, if the Display Settings are updated to change this value, it doesn't get dynamically reflected in the TextBox (it does normally if TextBox.Background h...