Winform Tooltip Control doesn't apply style on some computers - c#

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

Related

How do I change the color of the border of fields?

In the designer, the boundaries of the fields are drawn.
When I click the program, the borders are not drawn.
How to make that when you run the program, the borders of the fields were drawn?
Searching the DevExpress support site is always the best first option.
I found this on there. As it states not all skins support this and the default skin I was using "DevExpress Style" didn't. Changing skin to "Darkroom" did.
To display layout borders, set the LayoutControl.OptionsView.DrawItemBorders Property to true and the LayoutControl.OptionsView.ItemBorderColor Property to a necessary color. Note that in specific skins, borders for layout items are not supported, so you need to either set the AllowItemSkinning option in supported skins to true or change LookAndFeel.Style to another style; e.g., LookAndFeelStyle.Flat. If you do not want to affect the look and feel of embedded controls, set the LayoutControl.OptionsView.ShareLookAndFeelWithChildren Property to false.

How to Add Image Background on MetroFrameWork C# Winform

I use metroframework GUI on Winform. I imported the files correctly. Other controls and properties are fine, but I found a problem, I couldn't change the background of a form to an Image file. I can see a small picture already imported at "Background Image" properties of a form. But the background is still white. Could someone please help? Thanks!
MetroForm I believe only has a Light and Dark Theme (White and Black). This can be changed under "Metro Appearance" > "Theme".
Then you can set a background image under "Metro Appearance" > "BackImage".
To have the image change with the Theme you would set "Metro Appearance" > "ApplyImageInvert" to true.
I don't think there's any option other than the Light or Dark Theme.
Hope this helps
EDIT:
To prove that you CAN add an image to the background using MetroFramwork and to negate the downvote.
Here are some screenshots:
Light:
Dark:
Settings:
In the properties menu set:
1. ApplyImageInvert to true
2. BackImage with your path
2. BackMaxSize to the size of your background image
Unfortunately, MetroForm doesn't support a background image. I suppose it's because that doesn't really fit into the Microsoft Design Language (Modern, Metro, whatever it officially is called).
The reason you're seeing BackgroundImage in the PropertyGrid, is because MetroForm is based on the Windows Forms Form control that supports background images. If you take a look at the MetroForm and MetroFormBase code, you can see that all the painting is overriden and there's not a single place where a background is drawn.
If you really want to have a background in your form, you can fork the project and implement it yourself. It's quite a small addition and shouldn't be much of a trouble.
Edit: To be clear, the original project, or one of the forks of the project don't have a capability to show background pictures on the form. It however seems that at least one of the forked projects do support Form background images using the BackImage property, as mentioned in ryantpayton's answer.

transparent tab control appears white

Anyway, I'm having a little difficulty with tab control. When I drag a new tab control onto a form, it appears white, rather than the grey (system colour) I was expecting.
When I look at the properties, its colour is set to web-transparent. Ok, so it should be transparent then (it isn't letting anything behind it show through). Setting the tab control back colour manually back to the system grey kind of works, but the tabs at the top still show as white. I'm assuming I could somehow change their colour as well, but I'm quickly getting into the realms of changing so many values from default, I'm clearly missing something type territory. I've googled every varient of "transparent tab control draws white" as I can, and although I found something to do with windows profiles, this seemed mostly confined to access 2003 using the vb you got access to in access.
I'm looking for any explanation as to:
what I need to do to correctly use transparency with tab controls
what I'm mis-understanding as the purpose of transparency in tab controls
how to easily change all the colours of the appropriate parts of the tab control to not be transparent.
I'm looking at windows forms for an MCTS, so please don't give a "you should use X instead" type answer.
No, getting white is certainly normal. TabControl and TabPage are rendered with theme colors when visual styles are enabled. So that makes the tab page white on machines with the standard Windows theme.
Yes, the default BackColor of Transparent is very unusual. You most certainly will never get actual transparency with that, unless you count seeing the background of the TabControl as transparency. The logic is pretty convoluted, rather than trying to explain it I'll just paste the MSDN explanation:
The default value of the BackColor property is the value of the Control.DefaultBackColor property unless the UseVisualStyleBackColor and Application.RenderWithVisualStyles property values are both true and the Appearance property of the parent TabControl has a value of Normal, in which case the default value of the BackColor property is Transparent. Child controls that you place on the TabPage inherit the BackColor value by default, so this behavior causes the background of the child controls to render with the current visual style.
Changing the value of the BackColor property automatically sets the UseVisualStyleBackColor property to false. If you want the TabPage background to render using visual styles but you want the child controls to inherit a BackColor value that you specify, set the UseVisualStyleBackColor property after you set the BackColor property.

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

win 7 can't paint combobox

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

Categories