When you set Enabled = false to a TrackBar, the result looks to the uninitiated user that the trackbar is still enabled (we superusers can tell, but that's only because we know what to look for). How can I make the trackbar more 'greyed out' to appear less 'enabled' ?
In this example, the second slider is disabled, but it looks almost as enabled as the other two.
As one solution, I've tried to change the BackColor of the trackbar control, but that makes it look ugly against the panel background colour. There are no other colour properties. Nor are there any style properties which could've helped.
I also tried overlaying it with a translucent panel by using panel1.BackColor = Color.FromArgb(128, 220, 220, 220); in an attempt to 'grey' it out more, but the panel doesn't respond to semi-transparency. This question asks how to do that, and no answer appears to allows a semi-transparent panel on top of another control (where the control is semi-visible).
Related
How do I achieve opaque CommandBar/AppBar while it's hidden in WP8.1? CommandBar's property Opacity works just fine, but only when AppBar is opened. Though even then you can see non-opaque rectangle at the bottom. I want my AppBar to be opaque at all times, even when ClosedDisplayMode is set to Minimal.
[UPDATED]
"This happens because when you create a CommandBar an automatic margin is created for the ContentGrid to free a space below it for the app bar. Give the Main Grid a bottom margin by -24 and your content will show behind the command bar Like this: Margin="0,0,0,-24"
[ORIGINAL COMMENT]
I guess it is not applicable to do it with the control itself. But the workaround is to give it an opaque color. You can give the command bar a color but reduce its alpha value that controls the color's transparency.
Example: that's the Color code of the "Red" color with 80% transparency: #CCFF0000
I have set up a ToolStrip in my C# WinForms project and have added a TextBox on it. I'm just curious whether it is normal that the TextBox is barely visible due to the colour of the ToolStrip and TextBox.
I could put a border around it or change the background colour of the TextBox but that just looks odd.
Is there some property which I haven't thought of which I could set to make it stand out more but not look out of place?
Screenshot added:
A very light border would probably be best. if you use the same color as the toolstrip, you won't really notice the border at the bottom, but it will make the top of the search box stand out. you might also want to add a margin around it, or less padding inside of it, so it doesn't fill up the whole hight.
Is there a way to add a simple border in a DevExpress XtraUserControl?
I tried the following but didn't work:
UserDefaultLookAndFeel=False
UseWindowXPTheme = True
BorderColor = Color.Red
BorderStyle = Simple
I do not want to add a Docked Panel. This is what I have now but I'm trying to reduce the ammount of controls being user to increase performance.
(I'm assuming you are refering to WinForms)
When I try to add borders to controls that do not support it, I use the following approach:
Put a Panel control on the form.
Give the Panel a Padding of 1 on each side.
Give the Panel a BackColor of the desired border color.
Place your XtraUserControl inside the Panel control as a child control.
Set the Dock of the child control to Fill.
This gives you the look of a 1 pixel thin border in your desired color.
Maybe not the most elegant or resource-saving method, but worked several times for me when nothing else works.
As an additional hint: I have overall extraordinary good experiences with the DevExpress support website. If my (or the other) answers do not satisfy your needs, I strongly recommend to ask your question again on their support website.
I have made a TabControl and want to use some controls (labels, textboxes, buttons and combobox drop-downs). The problem is that when I select a tab, the default background color is not the same as the default background color of the form the controls used to be on. The color of the tab and the controls are too similar and it doesn't look good.
I have looked, but people seem to say that it's impossible to color tabs. What is a good solution to this? Should I put some kind of frame, label or something else inside the tab to make the background darker?
It's easy to get your tab pages to use the same background color as your form:
Make sure that the TabPage you want to change is visible in the designer. Click on it to select it.
In the Properties Window, find the UseVisualStyleBackColor property, and set it to False.
And as a bonus, once you've set this property to False, you can specify any background color that you want for the TabPage using its BackColor property.
The reason that this works is that you're forcing the tab page not to render with visual styles (i.e., themes as defined by Windows). The default theme actually paints tab pages a slightly lighter shade of the color used to paint other 3D elements (like forms and buttons). The problem (under the Aero theme in particular) is that the color of the standard 3D elements is so light already that the tab pages almost look white!
If you're satisfied with the contrast of the controls against the standard background color of your form, I suggest that you simply set the UseVisualStyleBackColor property to False and leave it at that without specifying a custom background color. Respecting the user's default theme is generally the best practice, rather than trying to skin an application yourself.
EDIT: Note that this will not change the color of the tabs themselves at the top of the TabControl. To do that, you're going to have to specify it as owner-drawn and handle its DrawItem event, forcing you to do all of the painting yourself. In most cases, however, this is not necessary.
In a Winforms application (C#2, FX2.0, VC2008) I am using a Panel derived Control to display custom controls. The controls are arranged vertically and there are usually more than fit in the visible area of the panel.
I have drawn a litte sketch of it:
Panel http://www.ericschaefer.org/Panel.png
Sometimes (usually after scrolling inside the panel) rectangular areas appear to have their colors inverted (green part in sketch). These areas are random in size but seem always to be at the right edge of the panel. As you can see in the sketch the arrow buttons of the panels scrollbar are also inverted, but not the thumbslider and the scroll area.
By inverted colors I mean black becomes white, white becomes black, blue becomes brown, etc...
I am out of ideas.
Can this be caused by my application?
Is it even possible to draw into the scrollbar arrow buttons?
Any ideas?
EDIT: "Screenshot"
EDIT: I was wrong about the Panel. It has been a Panel in the past but it is now a UserControl. Like this:
public class MyPanel : UserControl
{
public MyPanel()
{
DoubleBuffered = true;
BorderStyle = BorderStyle.Fixed3D;
BackColor = Color.DarkBlue;
VScroll = true;
HScroll = false;
AutoScroll = true;
AutoScrollMargin = new Size( 0, 4 );
}
}
Are you using the System.Windows.Forms.Panel ? What did you meant when u said Panel derived control ?
If you are using System.Windows.Forms.Panel then, this looks like a problem with the custom control and not the panel.
could you provide more info on the custom control, if possible ?
From your photo it looks like something's highlighted, but the border doesn't match up with any visible controls.
Have you got an control that's hidden behind the rest somehow?
Solved:
Apparently it was the fault of the touch screen driver. I can now reproduce the behaviour. If you click the "scroll down" button on any scroll bar via touch screen and hold it down for a while it keeps scrolling when you release it (the button stays pushed). After that you can click whereever you want, there will always be the "inverted colors" on the left side of the scroll bar. It happens with any application (explorer.exe!). Now it gets even better: Generally in Windows if you drag a scroll bar thumb button you can drift off of the scroll bar if you keep the mouse button pressed. But if you drift away too far the button will snap back to its original position (where you started dragging). Try it! The inverted colors rectangles are exactly as wide as the area where you can drift off without the button snapping back. I don't even try to understand this.
We installed a newer driver for the touch screen which does not keep scrolling even after you released the "scroll down" button and the issue disappeared. My blood pressure is back to normal but all the grey hair is probably not turning black I guess...
Thanks anyways...