win 7 can't paint combobox - c#

I have my program that paint the backcolor of a combobox column in a datagridview.
I win xp everything works fine, but in win 7 the comboboxes have the gray color:
if you look the shot, you see that the combobox columns are grayed, but they must be yellow like the other columns.
if I use the old windows theme the grid is ok, but I wish use the new themes of win 7.
(i'm the developer, so I can change the code to paint the cell)

Hm, I hope someone comes up with a better solution, surely companies creating custom skins have this problem. There are the two solutions I found, either change the visual style or changing the FlatSyle;
Possible to use XP Visual Style in Vista/Win7?
Need to change DatagridviewCombobox cell background color in Windows7
Although this talks about the ForeColor, it may be also provide a fix for the backcolor;
How to change ForeColor of ComboBox's Selected Item? #Cody Gray

solved, use flat style for the combobox and the color is shown correctly

Related

Winform Tooltip Control doesn't apply style on some computers

I'm currently working on a c#/winform project, the winform contains a Tooltip that should have some custom style:
this.toolTip1.BackColor = System.Drawing.Color.Black;
this.toolTip1.ForeColor = System.Drawing.Color.Chartreuse;
But on my computer, the Tooltip doesn't have any of these properties, my groupmate does have this properties displayed properly.
I'm on Windows 8 , he's on windows 7 we both use Visual studio 2013.
If you guys have any idea...
Thanks.
EDIT: my mate tried to use W7 Aero Theme, tooltip's style doesen't applied anymore.
EDIT2: Just in case, i tried other colors, it doesn't work anyway, moreover, the colors i want to use work elsewhere in our project.
Ok i finally found the problem, i add it in case someone's got the same problem.
As read the Doc once again, i understood that tooltips are drawn y the system if you dont set OwnerDraw to true.
BUT if IsBallon is set to true also, it will "override" the owned draw and use system to draw the tooltip so it will ake it's default style value.
I just removed IsBalloon and edited the Draw event.
Worked

ListView disabled background color

Hi I draw my items in a ListView by myself (OwnerDraw = true). I don't use DrawDefault = true as I want to have consistent appearance in all styles (Windows Classic, Aero, etc). Now I have the problem that I have to draw the background even if the ListView is disabled. And I can't find the right color for that. The disabled background color of the item should fit the background color of the ListView dependent of the user selected style in Windows. Any ideas how to get this color? Thanks in advance.
I was looking for it, too. It is static member of ListView class: ListView.DefaultBackColor.

Telerik Winforms ChartView: How to choose a different background color for a chart label

I'm using Telerik WinForms, the lastest version.
I have pie chart, 1 series with 4 datapoint and assigned a custom palette with 4 colors (red, green, orange and blue), only first fill color, no additional setting. This works well so far. I also want to display the according labels. This works also, but all the labels have the same background color as it corrensponding data point/segment. That I would like to change.
When I don't use any palette than each segement has its own color but the all the labels have white background.
Is there a way to change the background color of the labels?
There is no way for me to switch any other than winforms.
Also if there is no way of doing it, I would like to know.
If you need more information and/or screenshots please ask, it would be no problem.
I asked the same question in Telerik forum and they provided a working answer. It can be found here http://www.telerik.com/community/forums/winforms/chartview/how-to-choose-a-different-background-color-for-a-chart-label.aspx

Change WPF control property on one theme only

I know this is a little petty, but... On Windows 7, the default foreground color for ListViewItems is, for whatever reason, dark blue. This confuses and infuriates me. I would like to make my ListViewItems have black text. But if I set my TextBlocks in the DataTemplate to have Foreground="Black", then it looks weird on Windows XP, since the Foreground of the selected item is supposed to be White on XP; with Foreground="Black" it's quite hard to read. Is there some way I can set the Foreground to Black only on the Aero theme and not on the other themes?
What about if someone uses a theme that you have not tested? You cannot control every single theme.
I suggest you to build your own ControlTemplate to achieve your desired visualization. In this way your controls will be displayed in the same way in all situations.

What system colour property do Windows tooltips use for their background colour by default?

I've got a window I popup that I'd like to style the same as the default Windows tooltip.
What system colour should I be setting the BackColor property to? There isn't a TooltipBackColor in the system colours property tab.
Apologies to Jalal Aldeen Saa'd but I'm already using System.Drawing.SystemColors.Info and this doesn't change from the default dull yellow colour when I change theme, but the tooltip backgrounds do, as you can see in this screen shot:
(It's actually a bug that you can get both the tooltip and the popup visible at the same time)
The windows default is called Info...
EDIT:
If you are in WPF (which supports theming) then according to http://msdn.microsoft.com/de-de/library/system.windows.systemcolors.infocolor%28v=vs.85%29.aspx it is System.Windows.SystemColors.InfoColor
this updates automatically with the chosen theme
EDIT 2- for WinForms:
it is a bit more complicated... you instanciate a System.Windows.Forms.VisualStyles.VisualStyleRenderer with a VisualStyleElement.ToolTip.Standard.Normal and then you can call GetColor on the renderer with System.Windows.Forms.VisualStyles.ColorProperty.FillColor
that gives you the current theme backgoundcolor of a tooltip
System.Drawing.SystemColors.Info
You can get it by new System.Windows.Forms.ToolTip().BackColor

Categories