GUI elements are only shown when mouse is moved over them - wpf

in my company we developed a C#/WPF application and everything works fine. By request of our customer we are limited to the .NET 3.5 framework. In the application there is a settings dialog which is displayed correctly on our companies windows 7 systems. Now our customer has sent us a screenshot that shows the dialog (a window) which is totaly blank. He also wrote that the ui controls only appear if he moves the mouse over them.
We are not able to reproduce this. It looks like a missing repaint of the window or something like this. It is working perfectly on several of our systems. Does anyone know what could cause this effect? We do not have any informations about the computer systems that are used, except that they use windows 7.
Thanks in advance

This can be a hardware render bug.
Try a software render mode(this needs a change in your source code):
Software rendering mode - WPF
Or just ask client to enable software mode on his machine:
https://msdn.microsoft.com/en-us/library/aa970912(v=vs.90).aspx

Related

WPF Window objects are blacked out on second screen in Windows 10

Forgive me if this is a technical issue rather than a software-programming one, but I am having difficulty determining the probable cause here, be it the .NET Framework or something lower level, perhaps graphics hardware. Essentially, no WPF application will run on a second monitor using my Windows 10 Alienware 13 laptop. The same application, on the same monitor, running under my Windows 8 Alienware 15, will work fine. Visual Studio 2015 is a similar case, if there might be a common factor. Any experience with this sort of issue would be appreciated
For me, the issue seems to be in the hardware acceleration in WPF applications, as disabling it made it impossible to reproduce the problem (which previously I had no trouble doing using winkey+arrows to move WPF from primary to secondary screen)
The following registry edit can be used to disable hardware acceleration inside WPF applications:
Windows Registry Editor Version 5.00
[HKEY_CURRENT_USER\SOFTWARE\Microsoft\Avalon.Graphics]
"DisableHWAcceleration"=dword:00000001
Sources:
https://support.microsoft.com/en-us/kb/963021
https://msdn.microsoft.com/en-us/library/aa970912.aspx
I faced the same problem with my Windows 10 and dual monitor ( laptop screen + second monitor connected by HDMI ).
The solution in my case to fix the "black window in the second monitor" was this:
Locate your graphic-card vendor configuration interface by right clicking your desktop. In this pop-up menu you will find something like "Intel graphics" or "nVidia configuration", "AMD Control center", etc...
Find the "scaling options" and change the value. I disabled the "scaling" (OFF) and the problem was fixed, so this issue is related with the auto-scaling of the windows when you move your application between screens.
Please find these screenshots as example from my computer:
Source: https://answers.microsoft.com/en-us/windows/forum/windows_10-start/dual-monitor-different-resolutions-black-program/58ec488a-b62d-4ce8-a058-5e01e2a54d9a
Disabling hardware acceleration for the application, worked for me. This can be executed at any point and works immediately. So you can call this when the wpf app is already running
RenderOptions.ProcessRenderMode = RenderMode.SoftwareOnly;
Microsoft manual

Getting only gray screen when launching citrix application

Recently we installed a .net WPF application on citrix. When I go and launch it from citrix using RES powerfuse, I only get a grey screen and no controls are rendered on the screen.
The application is open and the main window can be seen but everything is grey in it. The mouse pointer also disappears behind the application.
The funny part is when the people from the operations team launch the application, it works fine. but not for regular users. This makes me suspect it could be something to do with permissions, yet we have given the access to open the program to all users, thats why the icon appears in citrix in the first place
What server are you running the app on? I recall we hit a WPF rendering bug on certain versions of Windows Server (+ XenApp) where the app would only render properly for administrators. This was a .NET bug - nothing to do with Citrix per-say. From what I remember the WPF rendering engine was trying to get access to some system resource that regular users could not access. I believe we only saw this on 2003 servers.
Just did some further digging, I think this is the issue:
http://support.microsoft.com/kb/955692
For quick n temporary resolution:
Check your local machine resolution and Citrix desktop/application resolution.
Equalise the both it will work.
Ex: 1024/762 is the right resolution.
For test: Do maximise n minimize the screen you will see the change.

Silverlight 4/5 OOB Window Menu

I was looking at Silverlight for building a "cross platform" desktop application (Windows and Mac anyway), but there is one show stopper that I cannot find a workaround for. On the Mac OS, in Adobe AIR, the AIR apps have a way to modify the main window's menu on the Mac OS's menu bar (File, Edit, View, Help, etc). I cannot find a way to do this from a Silverlight OOB.
For Windows obviously I could just make my own menu right in XAML and use that. However, this does not fit in at all with the Mac OS and it will look very funky to Mac users. This may not be a show stopper for many people, but for me it is. What can I possibly do to get around this short of waiting for Microsoft to implement it? (Which I doubt they ever will.)
The only thing I can think of is to build my own OS X app with a single window that has a WebView in it and then navigate that to my silverlight app. However, I lose full trust elevation at that point which really sucks.
Create the menu bar in XAML, but only show it if you're running on Windows.
See https://stackoverflow.com/a/1429517/270348 for code about how to tell whether or not you're running on Mac.

Touchscreen Windows 7 WPF

I have an app which I need to make accessible for Windows Touch. It is not a multi-touch application. I've looked at Microsoft's guidelines for touch applications which is interesting. There is one thing I am not clear on though, that is text input.
I would like a keyboard to appear when I click in a TextBox field. Is there a way to use the built-in on screen keyboard for this?
The first monitor I tested with was a Wacom. It is an older unit that uses a pen. It had some software that pulled up an on screen keyboard whenever I clicked in any text field (in any application). It was very handy. I thought this feature was using built-in Windows Tablet software because it didn't look like it came from a third party. A newer monitor I just purchased (Elo) does not have this feature though.
Answering my own question so it won't show up as unanswered any longer... From my comment above:
Looks like I've found the problem. The general purpose driver for the monitor wasn't installing it as a Tablet PC monitor. The Windows 7 only driver will provide a Tablet PC control panel settings. Now a keyboard shows up whenever I click in a TextBox field. The Windows XP compatible driver must have been using a legacy sub-system...

WPF not rendering on remote desktop

I'm having problems with the rendering of a WPF app over a remote desktop connection.
The applications chrome is rendering, but none of the content is coming through, as if the window is not drawing. Instead the previous content of the screen is showing in it's place.
This has been a problem with the application running on both Vista & Win 7, with remote control being taken from XP and Win7.
The problem is not application specific, if I create a new WPF app, with just a textblock on the window, it will also not run. (Neather will the windows preview in VS2008 display.)
Is there some trick to getting WPF running under RDP?
I read on Kevin Dente's blog (from a twitter post) that he was having trouble with WPF apps in virtual machines. While not the same as Remote Desktop, it's possible the problem could be the same. Kevin was able to fix his problem by disabling hardware accelleration by creating a DWORD registry value at
HKEY_CURRENT_USER\SOFTWARE\Microsoft\Avalon.Graphics\DisableHWAcceleration
and then setting it to 1.
His original blog post is here: http://weblogs.asp.net/kdente/archive/2009/10/19/visual-studio-2010-beta-2-editor-performance-fix-running-on-a-virtual-machine.aspx
That may not be your exact solution, but maybe it points you in the right direction.
WPF should render over RDP; it's smart enough to know when it can render in hardware, and when it can't it reverts to its own GDI+ based software rendering. I would make sure you're running .NET Framework 3.5 SP1 on the remote machine, since there were changes to remoting that might pose issues. (See link below.)
I've been developing a WPF app for the past 6 months and it works just fine over RDP. (From Vista and Win7 to XP, Vista and Server 2003.) One important caveat, however, is that it renders using the Classic theme. So if you're using controls that don't have a classic theme, they won't render. If you're just dropping a TextBox on a Window, then obviously that's not your problem.
Check out this question for some links that may be helpful: Are there problems with rendering WPF over Remote Desktop under Windows XP?
I just had this problem with the ribbonwindow not displaying correctly when testing for the first time via RDP - the transparent background was white, the close minimize/maximize buttons were missing, the rounded corners on the bottom of the window were square, and the top row of ribbon buttons were almost impossible to select.
Turns out there was a simple fix for me. Right-click the RDP connection icon (I have it saved on my desktop), select "Edit", then the "experience" tab, and change "detect connection quality automatically" to "LAN (10 Mbps or higher)".
This fixed it for me.
Ade
Did you also try Win7 latest RDP - Win7 connection? The thing is WPF doesn't use GDI to draw elements.
VNC clients (like UltraVNC) probably will do the trick for you as they using much simplier algorithms more like of sending bitmaps.
I have the same problem than the asker. The standard, out-of-the-box Checkbox is not rendering correctly. I can only see if it is checked when hoovering the checkbox. Otherwhise, no difference between checked and unchecked. Important note : It occurs when setting the foreground to white (see here : https://social.msdn.microsoft.com/Forums/vstudio/en-US/1c03db49-7e53-4cbb-9dd1-b328017c4453/wpf-checkbox-and-radiobutton-check-mark-not-showing-under-xp-windows-classic-theme-and-remote?forum=wpf)
Our application used to have this problem with a custom progress bar.
We fixed this by setting the background color of the Border control to White. This leads me to think there is an issue with transparent backgrounds
There is no special trick needed to get WPF content to show across remote desktop. Our WPF-based app renders just fine over RDP (tried from numerous machines) with no problems. We're even using animations, gradients, WriteableBitmap, etc. w/ no problems.

Resources