We have a huge project in WPF .NET 4.0 which should support Windows XP SP3 and above. (hence the use of .NET 4.0) It has no problems whatsoever on Windows 7 and 8/8.1. However we're experiencing major visual issues when running on Windows XP to the point that the application is unusable.
I searched a lot and came across some similar questions such as this one but none of the suggested solutions worked for us.
Here's an screen shot taken on Windows XP SP3:
The odd thing here is that there is clone of "28" TextBlock you see in the screen shot, to the left of it. They have everything in common except their name but the left one is not rendered properly!
And here is how it really looks like (taken on a Windows 8.1 test machine):
Some pages are even worse:
When I remove AllowsTransparency from the main window, it looks like this on XP: (Note that the title bar has no problems any more)
We're really stuck and have no clues about its cause. Any help would be appreciated.
It seems this problem is related to the graphic card. In another VM with a different graphics accelerator we didn't face any major problems. In the problematic test machine, we lowered hardware acceleration to the third level and the problem is gone.
Display Properties -> Settings -> Advanced -> Troubleshoot
Although there are still some small issues with some mouse over animations and we lost the benefits cursor accelerations bring to the table, it's acceptable for us since not much is expected from Windows XP.
Related
After updating windows to version 1803 none of the WPF applications on a laptop (Intel hd 500 GPU) work properly anymore (start with a blank window or don't show the GUI at all). I've made a simple test app that only shows one button and it results in an empty window. If I turn off the hardware rendering (according to Software rendering mode - WPF), the application works as expected.
I've tried several versions of the GPU driver including the generic MS one, latest one, latest one recommended by the laptop manufacturer, older ones but all with the same result. The recovery point to the previous version is not available anymore.
The laptop is barely running existing applications so setting the registry not to use the hardware rendering for all the .net applications is not an option due to performance degradation.
Has anyone experienced anything similar, are any other solutions to solving this?
Thanks,
Tomislav
The issue happens because I'm using the laptop with the lid down (I connect remotely to it). This seems to put the GPU to sleep/power down state which messes up the applications that use GPU acceleration. Interestingly desktop and some applications run normally.
Adding a fake display solved the issue (https://forums.lenovo.com/t5/ThinkPad-X-Series-Laptops/Working-with-closed-lid/td-p/1623610, https://superuser.com/questions/1271344/fake-montitor-for-teamviewer-on-laptop-with-closed-lid).
I have also had this issue and have found that if you uninstall and delete the Intel Display Adapter, then let Windows automatically find the default, this issue is resolved.
I have Windows 8.1 on a Virtual Machine (Oracle VirtualBox). I use this machine to develop apps on my windows phone (directly on the phone, not via emulators).
Everything worked fine for a long while and suddenly, out of nowhere, the designer stopped working...
The problem looks like this:
I can add controls, however I cannot see them in the designer, only shows some black square at top-left of the phone designer. (It works fine later on the phone, but I cannot view it in Visual Studio). There are no errors anywhere. It is really annoying and I cannot seem to find any answer so far...
Any ideas?
Thanks,
Keran.
Posted by Varun Mashru on 5/23/2014 at 3:54 AM on Visual Studio Feedback Forum
Surprisingly and fortunately, I found the solution just two days ago.
It is a bit of a bummer but that's what it is.
It has nothing to do with the VS setup or the OS.
The first thing to notice here is that it happens with notebooks only.
The REASON??
Because notebooks do not have completely dedicated GPUs. These GPUs
act as secondary processors for the onboard graphics solution which is
directly connected to the display. Hence they fire up only when
needed.
My notebook is a Dell Inspiron 15 3537 -- Core i5 4200U (Intel HD Graphics
4400 onboard) + AMD Radeon HD 8670M. It has a switchable graphics
solution. Hence the software chooses as to which GPU does the
weight-lifting.
The power settings, when cranked up to the max, indicate that the AMD
GPU must be the one that should take the lead.
And in the case of VS it does not happen properly (Don't know why??).
Maybe the UI components can't decide which GPU processor to choose
or whatever.
So the simple workaround I found was to bring the graphics settings
down by just a notch. Which is selecting the 'Optimize Performance'
option in the Switchable Graphics instead of the 'Maximize Performance'
field in the power plans.
And voila, It works perfectly fine!!!!
Share this with everyone who has freaked out for months on this
issue!! :)
Though the answer from Hassan El-Zarkawy is also useful, the real problem for me was with Oracle Virtual Box...
At some point I have turned on 3D acceleration for the VM. This messed up the designer in the Visual Studio. As soon as I turned it off, everything worked fine, even on the high performance battery setting.
I don't know if it matters, but I also switched to 1 core for the virtual machine, it seems to work better now apparently...
Anyway, thanks for the help.
I have an issue with my C# application. It's about controls on borderless form. I've created a application that works like a logging system (shows in center of the screen, has 2 textboxes, 2 comboboxes, 2 pictureboxes, form StartPosition is CenterScreen). The application works fine on almost every system, 30 - 40 people are using it, but 3 of them has a problem, that makes the app useless.
The controls are totally moved and seems little bigger than they
should be, 2 of these controls are moved even outside the form - which
makes them inaccessible.
I've tried to set the compability mode and change the screen resolution. No luck.
All of these problematic machines has Windows 7 and default .NET 3.5.1, one has 4.0. The application was targeted for .NET 3.0 (I wanted to keep it free from dependencies on machines with Vista and newer).
I'm looking for a advice from those, who had experience with this kind of problem. I would like to keep the form borderless, its essential for its design, and keep the target framework if possible. What can i do to keep this in solid ?
I'm guessing you have problems with DPI. Try increasing it on your dev machine and I bet you will see same effect. I hadn't worked with winforms for a long time, but I think you can use this article to help you out.
I have a .Net application that was originally created in Visual Studio Professional 2005, using the .Net 2.0 framework.
Recently, I have opened the project in Visual C# Express 2010, made some minor changes, and built it using .Net framework 4.0.
Everything works like a charm except for one quite annoying part. When I am running the application on a HP EliteBook 8740w, with a 1920x1200 screen, a group of GUI controls get shuffled around, so that they land on top of eachother. This error does not show up when running on my Windows 7 64 bit workstation with external display of 1900x1080 resolution. Neither does it show when running on a Windows XP laptop with 1024x768 resolution.
I have tried to connect a 1600x1200 external display to the EliteBook, but the error shows up there also.
The controls that get messed up are a set of comboboxes, numericUpAndDowns, and labels, laid out in a table layout container, that in turn is placed on a tab page in a tab page control.
I have tried creating a new tab page control and table layout container from scratch, and then moving the comboboxes etc into the new table layout container, but the error prevails.
I would really appreciate some help in this matter, because I don't know what else to try. I am starting to suspect that there is something wrong with the graphics on the EliteBook, but, then again, everything else renders nicely on its screen.
Thanks,
Fredrik Israelsson
--- Edit ---
Thank you for your quick answers. Before I had a chance to look at them, I think I solved the problem by myself. Stumbled upon a thread about why Visual Studio automatically changes sizes of controls although one has set anchor and dock properties to None. One of the answers mentioned the AutoScaleMode property. I changed AutoScaleMode from Font to None on my main application Window, and no the GUI renders nicely on all my computers.
Thanks again!
/Fredrik Israelsson
I suspect that this is because the two machines have different DPI settings. This is always a pain with Windows Forms.
Here are a few links that might help.
http://msdn.microsoft.com/en-us/library/ms229605.aspx
http://www.sellsbrothers.com/writing/winformsAutoScaling.htm
It could be related to Hardware Acceleration. Is your application a WinForms or a WPF one?
I have faced really odd behaviors when using VS2010 on Win7 64 bit only because it was trying to use Hardware Acceleration when I built the app.
Improving Performance by Changing the Visual Experience
You might have a problem with Hardware Acceleration in VS2010. I had an issue with rendering applications built using WPF because of this.
Give it a try: http://blogs.msdn.com/b/zainnab/archive/2010/06/22/improving-performance-by-changing-the-visual-experience-vstipenv0017.aspx
And if that doesn't fix your issue, go to your video card settings (nvidia or amd catalyst) and do a "reset settings" on the computer where the app doesn't correctly paint itself. Then try again.
I have a fairly large application that uses WPF for its user interface. I recently found an unusual defect regarding 3D screensavers. The 3D screensavers 3D FlowerBox,3D Flying Objects,3D Pipes,3D Text causes 1 of my WPF windows to disappear when the screensaver activates. Other screensavers are fine.
My application only encounters this problem on Windows XP.
I have some experience with DirectX. When a 3D screensavers activates, the d3d device context will be switched to exclusive mode. I reckon that WPF has trouble restoring the device context when the device switches back to cooperative mode (hence why its only affecting windows XP)
Has anyone seen such a scenario occur before ? Is there a remedy for the problem ?
Windows XP SP3, DirectX 9.0c, .NET 3.5
Not that exact one, but I have definitely seen strange problems with WPF and Windows XP, especially. The easy thing to say would be that you should try to move to Windows 7 ASAP, but then I would just be a jerk.
First off, check your video device driver. We've had a lot of problems with WPF on XP when an old graphics cards' device drivers are used. Update it to the latest version. That could take care of it.
If that doesn't work, and if you can, try swapping the video card for a different brand. That, too may work (though highly undesirable).
Third -- is your window semi-transparent or non-rectangular? If you switch your WPF app to be a regular, rectangular, boring, ugly Windows XP window, we've found that a lot of these quirks went away when we stopped getting fancy with our main windows. My guess is that it has something to do with the fact that XP has no desktop window manager. But then again I don't really know.
I know this is all very unsatisfying. We've had stuff like this happen to us on XP. I'm praying for our IT department to be able to move us to 7 this year...