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.
Related
I'm having a problem when trying to change the highlight color of selected text in WebBrowser Control.
What I'm trying to do is making the selected text not hightlighted.
I used this css.
<style>* ::selection{color:#000;}</style>
It worked with IE, but when I try with WebBrowser Control, the text is still be highlighted.
Any help would be appreciate. Thanks!
Update: I notice that the selected text color in WebBrowser Control is changed depend on color of Selected Item in Windows Color and Appearance. But I cannot make the highlight color transparency.
Maybe <style>*::selection{text-decoration:none;}</style>
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.
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
OK so i am passing an Observable collection to the itemsource of a listbox the collection has a color property, and i had been doing the background color within the grid inside the listbox by binding the color. However I need to have the item change color when the mousover event occurs, which doesn't show because the background drawn to the grid overlays the color change on the listboxItem. When I try and bind the color to the listboxitem however it throws an exception.
I could really use some help here I've tried everything i can think of and find.
I found the solution, it turns out this is one of the limitations in Silverlight that is known to the silverlight team, a blog post at http://blogs.msdn.com/b/delay/archive/2009/11/02/as-the-platform-evolves-so-do-the-workarounds-better-settervaluebindinghelper-makes-silverlight-setters-better-er.aspx demonstrates a method to force a binding on a control.
you can write the mouseenter and mouseleave events ,in the mouseenter, you remove the grid backagegroud color and add the item's backagegourd's color. in the mouseleave you remove the item's backagegroud's color and add the grid's backagegroud's color
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