Im currently developing a piece of software, however ive run into a minor problem with VS2013.
In the form designer, while I am designing the windows have a Win8 style window theme like this:
However when i actually run the program, the it uses a Win7 style window theme like this:
The change of border size kind of messes with my layouts and i was wondering if there was any way to make VS2013 preview with a win7 theme?
Related
Using Windows 11 and WPF, when I change the background color of the window, the window flashes white, then after a couple frames the proper color of the program shows. This is really annoying, since the program I am working on is small and has dark mode. Checking the internet, there aren't many results, but the "solutions" typically involve initially minimizing the window, then showing it when everything is loaded. This is fine, except on Windows 11 it creates a really distracting "show" animation, and it's somewhat more of a flash then a solution. Some have recommended a splash screen, but this shouldn't be necessary since the program I'm working on is very simple.
There is a chance that this is either:
a Driver/Graphics problem
a bug with WPF itself
Steps to reproduce:
dotnet new wpf
add a background attribute to the window (I have tried setting the background to the Window in C# instead of XAML and setting it to the layout, neither make a difference), and set it to a color
dotnet build
and run the program.
For no reason I can think of - there have been no code changes, My WPF application has stopped showing the window frame in the Windows 8 style and seems to have reverted to a Windows XP like style (weird grey border around the main window and grey, raised buttons for minimize,maximize and close in the top right corner.
If I try and resize the window you can see the Win8 style buttons trying to draw "underneath" before the grey button style draws over it. (that's the best I can describe it)
Does anyone know why this might be happening?
How can I achieve the same alpha border effect that can be seen in the new Visual Studio 2012 main window using windows forms? Its window seems to glow.
So I am not sure if it is the best method, but if you use Spy++ (32-bit) and you look in the windows, you can see that beneath Visual Studio's main window, you can see 4 "VisualStudioGlowWindow" objects.
I hooked the messages in Spy++, and as you could imagine, the 4 windows represent the 4 glowing borders around the form. Further inspection shows that these 4 "glow windows" implement the WS_EX_LAYERED Extended window style, so the glow itself isn't done in WPF (as far as I can tell.)!
Hopefully this clears some stuff up.
AFAIK you can do it with WPF using a mix of this chrome and a custom WPF border. Not sure if on WinForms you can, given it's limited styling options (compared with WPF). Anyway they are using WPF.
Unless you want to handle drawing the entire form yourself you cannot. Because Visual Studio 2010 and Visual Studio 2012 are written on top of WPF and used Windows not Forms.
Visual Studio 2012 draw its window border using native Win32 functions. It is not related to the WPF or WindowsForms -- you can do it with both.
The glow is rendered on a transparent window on top of the main window. The main window calls the DWM API to set the glass area to 0. This way you can draw over the original border and the system buttons. This is the correct way to do this.
You can look at code of WPF Shell (http://archive.msdn.microsoft.com/WPFShell) to see how the calls to DWM are made in order to remove the glass. The fact that its written to be compatible with WPF doesnt matter, because all you need is a handle (IntPtr) to the window.
If you have a WindowsForms codebase, don't migrate to WPF. WPF has not been improved in the latest .NET framework release and there are no roadmaps to improvements or new features as its team has been integrated into Windows 8 team.
I'm using DotNetBar in VS for C#, and when I change the form to office2007, the design preview looks right, but then when I run the program, the style changes back to the default winform style.
Does anyone know what's causing this?
If you are running on Windows that has Glass then you need to set EnableGlass=false
In Windows XP's CMD, the Luna border isn't applied to it. alt text http://wedowebstuff.info/uploads/1272861285CMDNotThemed%5D.png
Is it possible to do it in a similar way in Visual C# Winforms, for an application? I just wonder how it's done, of course I am not going to force any of my applications to not use the beautiful XP/Aero theme :P
Thanks.
edit: Adding a note to this after many months. The Luna border isn't applied to CMD due to the fact that it is technically a 16-bit (old) application, so it does not use the standard Windows theming system (nor windowing, as demonstrated by the fact that it cannot be maximized). Applications like this are common in 32-bit windows (16-bit apps were removed in x64 Windows builds), for example, sysedit. The fact that it has a properly themed window border (but note, not the inside controls) in Vista/7, is due to the fact that Aero/Desktop Window Manager (DWM) overrides all window borders and renders them. If we switch to the Basic/Classic theme, that inconsistency continues.
The x64 cmd.exe doesn't have this problem. :)
I don't know how to modify the border, but on a side note, I do know how you can control the appearance of controls. As far as I know (I am a Linux programmer so I have limited knowledge in this field), without XPCommonControls enabled, you will have "old-style" controls, but with it, you will have "nice" buttons that are styled with the system style settings.