I'm sure it has been asked before (but couldn't find any resources that solves my problem), I'm creating a Silverlight application where users may install and use in OOB mode, using elevated trust. I want my "windowless window"s background to be transparent so I've set the app to run windowless in OOB mode, and put some margin around my Grid (main grid) along with a drop shadow effect. What I'm trying to achieve is the "zune window" effect: a rectangular main borderless window with drop shadow. I was able to do it in WPF but in Silverlight, I'm getting a white background:
I don't want this white background, and I've double checked that NOTHING has a white background set, but I'm still getting this. How can I get rid of that white border (obviously while keeping the drop shadow effect)?
The short answer is: you can't.
The long answer is: The Window object represents a client window with a solid color background and there is no way to change that color.
Related
I have a problem that appears to be new to Windows 10.
I want to create a form that is visible to the user, but with no task bar icon and that does not appear in Alt+Tab.
This is perfectly doable if one is happy to sacrifice the normal styling of a window by following the accepted solutions here for either WPF or Windows Forms.
The general advice for both WPF and Windows Forms is:
Set ShowInTaskbar to false
Enable the ToolWindow styling (either through setting the border style in WinForms or the WindowStyle in WPF)
However, this has a new, practical problem in Windows 10 when using Virtual Desktops: the moment you do the above, the WPF or WinForms window will appear in every virtual desktop. See my example application with a red background:
This affects both the Task View switching screen and the actual desktop itself. No matter where you go, the form is there!
Is there any way to show a form - or even just a bitmap - on Windows without anything appearing in the taskbar, without anything appearing in Alt+Tab and without duplicating the window on every virtual desktop?
I have spent two days researching every possible option, trying every example online, reading MSDN documentation on window styles etc. but all resort to the same method, either through P/Invoke calls or directly, but either way the result is the same.
A few of my users are experiencing a strange bug. I have a simple WPF window that contains a few textblocks and buttons. After a short time using my application successfully the users that experience the problem report that the window's content becomes empty and only the border of the window is visible.
After remoting onto their machines I have confirmed that it looks like the content of the window is frozen. When the window first opens it appears like its see through and displays whatever is behind it. If I move the window around the same frozen image of what was behind the window when it opened stays there. If I bring something in front of the Windows (such as a browser) the "frozen image" in the contents will change to a frozen image of whatever was in front of it. I have discovered that the buttons are still active and clickable in the window, so it's not completely frozen it just seems not to be drawing the content properly.
The issue only seems to affect a small percentage of my users and I cannot recreate this issue on any of my test machines. Any ideas about what is happening would be greatly appreciated.
If you have a user that's willing to experiment to find a solution, have them Disable Hardware Acceleration in WPF. If this fixes the issue, then it's most likely a graphics driver problem.
I am aware of the following question:
I want to disable the shadow effect on a specific aero window
However, I still need the DWM blur/reflections behind my Aero window, so I can't create a custom transparent one. How would I approach that? I could handle the reflections by myself, but I don't know how to create a blur.
Done it using DwmEnableBlurBehindWindow. :)
I create a simple WPF UserControl (any control will do) and insert it into a Winform (using an ElementHost).
This works fine. The WPF control is embedded in the WinForm and when the WinForm is moved around the WPF control moves with it just like a WinForm control will do.
When I change the WinForm to transparent by setting the TranparencyKey to the same value as the BackColor some problems occur:
- The WPF control is not displayed - instead a black rectangle is displayed in its place..
- If the WinForm is moved around the screen then on its original place the WPF control appears - as if it was covered by the WinForm.
Changing properties of the ElementHost (such as BackColorTransparent) did not change the behavior.
Setting both the BackColor and the TransparencyKey of the WinForm to Black got rid of the black rectangle problem but still when the WinForm was moved the WPF control was left in the original place.
Note also that these problems occurs under Windows XP SP3 (which is our target OS) but not on Windows 2003.
(We did not check on Vista and Windows 7).
Any ideas how to have a transparent Winform with a WPF control inside and still get a normal behavior?
Did you set the background property on the WPF control? By default it inherits from it's parent container and if it's not present it will do this. Try setting the background property on the UserControl to white or grey and your problem should go away.
Has anyone been able to solve the airspace issues when trying to play a flash (swf) movie in a WPF application? I've been able to play the swf file using a WinForms control and a WindowsFormsHost element, and also using the WebBrowser element - but both have the airspace issues.
It depends on exactly what you're trying to do but I've used a transparent overlay window with success.
Track the underlying window's location and update the overlay window's position accordingly.
Ensure that you update the overlay window with minimize/restore/maximize modes.
Set the overlay window's Background to Transparent and the AllowsTransparency to true.
It's a bit of a hassle but not too bad.