is there any way that winforms or WPF can do this kind of UI? transparent with blur window.
A forenote: Windows 8 removes the Aero Glass effect. Windows will appear with a solid background where there would be glass (like how they appear on Windows 7 when you disable the glass effect but still run the DWM).
That said, the effect is done using Win32's DwmExtendFrameIntoClientArea function. Using this in your program differs depending on whether you're using WPF or WinForms (as WPF windows do some pretty interesting window subclassing, and of course, WPF controls are largely windowless).
To get a "whole glass" window, you just use the DwmExtendFrameIntoClientArea function to fill your window, rather than just the first 50px or so, which is what IE and other browsers do.
This is the canonical MSDN article on how to do this with WPF: http://msdn.microsoft.com/en-us/library/ms748975.aspx
For WinForms, see this blog article: http://blogs.msdn.com/b/tims/archive/2006/04/18/578637.aspx
Enjoy, but not for long considering Windows 8...
Related
I am currently developing a small WPF application.
I have noticed that, especially in Windows 11, the Button and Menu controls look noticeably dated. Win 11 brought rounding to all of these, but WPF seems to be using an older, more square, styling:
Typical rounded button in a Win11 application vs. the default look of the <Button/> control in WPF:
This also applies to the <Menu /> - if we take a look at a typical program's menu UI styling under Windows 11 vs. the style in my WPF application:
Why does WPF have these different styles? I have been reading around and there's lots of mention about adding a reference to Microsoft.Windows.Common-Controls in app.manifest but this doesn't seem to have made any difference to these controls in my case.
What's more confusing is that the actual WPF window itself has rounded corners, and the context menu for right clicking the title bar of this window is using the new style - it seems to be controls inside the window that are plagued with the older styles.
Any help/info would be much appreciated!
WPF is officialy dead. That's probably the reason it doesn't receive new features, like the new theme (and more than 60 fps, stereoscopic rendering or native DirectX 12 without a picture buffer to transfer to DirectX 11 in WPF). Those other apps are using the Windows API for GUI, so they don't need to be even recompiled to get the new design. WPF is drawing GUI on its own, so it would need a not-so-small update, which is not economical.
I'm building a WPF application that is designed to act as a notification toolbar for sending messages to users of an enterprise software platform. It's a bar that is a specific height, stretching all the way across the bottom of the user's desktop, sitting directly above the Windows taskbar.
What I'd like to do is to have my application "claim" or "reserve" the space it takes up and not allow any applications to load behind it. For example, if you were to resize your windows taskbar and make it larger, it will move icons and shortcuts, and maximizing windows will only use the desktop area that is not already being used by the taskbar.
Any idea how this could be pulled off? It's already set to be the topmost item on the desktop, so that's not my question. Right now if you opened another app and maximized it, then the bottom X pixels will be hidden behind my toolbar application.
(Note that I've added Windows 7 and Windows XP tags - I'd love to be able to implement this functionality on WinXP and up, but if I'm not able to do so on a particular version or versions, I can come up with a workaround)
These are called AppBars in Windows and you can use the SHAppBarMessage function to "dock" your window to a side of a monitor. Then other windows, when maximized, will not obscure the docked window.
Here's a link to a similar question that has more information, including a link to a CodeProject page that walks you through creating one.
I have an application where, beyond my control, several Windows Forms have a TransparencyKey property set. When these windows cover (are in front of) another form which has a DirectDraw video surface, the foreground form flickers (partly showing the form and partly showing the video beneath). The thing is, the color of the TransparencyKey doesn't appear anywhere in the application, so NOTHING should be transparent... in other words, the result should be that the foreground form is completely opaque.
Does anyone have experience with DirectDraw surfaces flickering when combined with Windows Forms that are in some form or other set up to be transparent? I've worked on this for weeks, with no success. Thanks!
I'm sorry but I would suggest that you abandon that goal completely and try to do it some other way.
DirectDraw is one way of displaying stuff on the screen, and forms with regions (that are created on the fly as masks from so called 'transparent key color') are done with GDI. As I see it (and would like to be proven otherwise) - you won't be able to combine that two windows anyway.
And you will probably get different results on different Windows, depending on the version, graphics card used, and so on.
On the other side, can you hack those forms that you don't have the control over and remove TransparencyKey property from them? Even with Win32 API?
how to make somthing like this
Windows Forms Glass Effect, Make ImageBox transparent
I use VS 2010
If all you are looking for is the standard glass effect (which includes the blur), check out this article:
http://www.codeproject.com/KB/vista/AeroGlassForms.aspx
Basically, all you're doing is extending the window's frame (which already has the glass effect) into the client area. You have to call the DWM API that come with Windows Vista or later using a couple of P/invoke methods because this is not built into the .NET Framework.
EDIT: If you're looking for more control over the blur effect, you might look into more specifically the DwmEnableBlurBehindWindow function from the DWM API, although I have not used this myself.
Take a look at this:
http://msdn.microsoft.com/en-us/library/aa969512(VS.85).aspx
The MARGINS array is similar to margins on an HTML page. The first example on MSDN gives the margins for the glass effect 25 pixels in height on the bottom of the window.
This MS tutorial is fairly easy to understand and uses C#.
I am developing a winforms MDI application in C# in VS 2008.
I have noticed that the MDI forms don't have the glass look under Vista.
Is this by design?
Is there a simple way to get the glass look for these windows?
By default glass is not enabled on WinForms (or for that matter WPF applications). The only way to enable glass is to PInvoke into native API's. This channel9 site does a tutorial for a great utility that makse it trivial to add Glass effects to your controls.
http://channel9.msdn.com/playground/Sandbox/201158/
Nope, Glass is not available for MDI children.