In WPF XAML, WindowStyle can be None, SingleBorderWindow, ThreeDBorderWindow, ToolWindow.
I tried the options myself and also looked into MSDN, yet I cannot tell any difference visually between ThreeDBorderWindow and SingleBorderWindow. The "ThreeDBorder" looks just as 2-D as SingelBorder. What are their difference?
You have to switch to Windows Classic theme to see the difference. If you are using a "modern" theme like Windows 7 there is no difference.
Below you have the SingleBorderWindow to the left and ThreeDBorderWindow to the right when using Windows Classic theme on my computer. (The innermost gray border is from a control in the window and is not part of the window border.)
The "3D" border has an inside highlight that I guess gives it a raised or three dimensional look.
Related
I started a Codename One project with the "Hello World bare bones". I used to define the styles in the Theme tab from the Designer but now it is becoming tedious.
Actually for some selectors, even if I override (unchecking the Derive box) some properties the style is not changed in the Designer (see below) or in the app itself.
However, in the list of selectors, the color is not the one I selected but the alignment seems to be it.
It seems that the theme is locked somewhere. Do I make a mistake, or should I set a constant to "unlock" the theme, or even should I clear some directories?
Please note that I am using NetBeans with designer V 1.1
.
Edit March 1st 2017
Following #Diamond's great tips, I was able to change the foreground color by setting the Border to empty (instead of NULL). However now the alignment is still not what I expect (see below). How can I do for this property ?
Any help appreciated,
In the Designer, Border is superior to background color and background image. Which means if the border image is set, a background color will have no effect unless the border is just a stroke or line.
Always solve this with these few steps:
Go to the Border tab and uncheck the override.
Click the ... button next to Border Help and a new Dialog will show.
Change the Type (First line) to Empty and click Ok.
Your background color will now have an effect.
I have a Windows form control that was built using Telerik RadTools for Windows Forms. The form is styled nicely using the "Office 2010 Silver" theme. However, at runtime, the theme seems to throw-off the alignment of some of my labels.
I have several rows of labels and textboxes on my form. I want the labels' right sides to all line up. This is easily done in the Visual Studio designer. However, I believe my Telerik theme is throwing things off because it slightly changes the font, which alters the labels' sizes as well. Since the designer only stores the x,y coordinates of my controls, the labels' right edges no longer line-up.
Is there a way to code around this?
I fixed this by doing the following on all labels:
Set AutoSize to false.
Set x-location to that of the widest label.
Set size equal to that of the widest label.
Set TextAlignment to right.
Since all labels will have the same width and the same starting (left) location, their positions will now be fixed. Setting the alignment to the right takes care of the problem.
With visual styles, i can use
VisualStyleElement.TreeView.Glyph.Closed
and VisualStyleRenderer to draw [+] button like in TreeView.
But when user have a "Classic" style in Windows, visual styles are not supported and I still need to draw this glyph.
It is still possible to use classes like
System.Windows.Forms.CheckBoxRenderer
but I haven't found anything like this for TreeView glyphs.
Yes, it is not possible to get that glyph. It is a simple one but you have to write the code. DrawRectangle and DrawLine. Or use a bitmap. Or make it look like the simple Vista triangles. Or don't enable ownerdraw when visual styles are off.
TextBox seems to work differently from others...
Say you want a different font, rounded corners, different colors, a tiled image for the background, reduced padding above/below the text (when I change the font on an individual TextBox they get a little too tall but there's a lot of wasted space), etc. How do you do this in Blend 4?
I'd like it to be in App.xaml so that it's used by default for all TextBox controls in the app.
I think everything you mentioned can be done using controltemplates.What is not working ?
Check this link
http://msdn.microsoft.com/en-us/library/ms752068%28v=vs.85%29.aspx
It will get you started for sure
I'm using DwmExtendFrameIntoClientArea in my WPF application to get the glass effect. This is working fine. What I'd like to do is change the colour used for the glass -- I'm writing a countdown timer, and I'd like the window to be the normal glass colour most of the time, and then to go red (but still with glass) when the time runs out.
I found this question, which talks about how to apply a gradient glass, and that works fine when picking a different colour. Unfortunately, the borders are not coloured appropriately.
When I turn off the borders by using ResizeMode="NoResize", then I end up with square corners. I'd like to keep the rounded corners.
I looked at creating an irregularly-shaped window, by using AllowTransparency="True" and that works fine, but doesn't look like an Aero glass window. It looks a bit flat.
So: my question: how do I create a window in WPF that looks like Aero glass transparency, but uses a different colour?
I think the only possible way to achieve this is to use a semi-transparent filled border and draw it over the entire window or the part you got the glass. Its a workaround but I guess it's a possible solution since the color of the glass gets defined by the system-user and this setting would overwrite yours.
I'm asking the same question myself.
I haven't found a good solution, though the best I've come across so far is doing the following:
HwndSource.FromHwnd(hwnd).CompositionTarget.BackgroundColor = Colors.FromArgb(100,255,0,0);
Unfortunately this tints the minimize, resize and close buttons, which I would rather avoid.