I have created a wallpaper changing program in C# using Visual Studio and I have had a couple reports in this last few months of part of the program not displaying right. I have no clue what is causing it. Any help?
This is what it looks like on my computer, Windows 7
This is what it looks like on the victims computer, Windows 8
If this is a windows Forms application, it could have something to do with DPI/resolution scaling. This isn't unique to Windows 8.
Check the Display sizing options match on both displays (or simply change on your Windows 7 Machine) in Control Panel.
Control Panel\Appearance and Personalization\Display for Windows 8. (I think it is the same for Windows 7).
See C# WinForms disable DPI scaling
or
How to write WinForms code that auto-scales to system font and dpi settings?
Related
My WPF application's font suddenly looks different on my PC. I am not sure if this occur after a windows update. I am using Windows 10 Version 1803, .Net 4.5 in one application and .Net 4.6.1 in the other. This is happening on my 2 WPF applications.
Here is a picture of my WPF application on other PCs (Acceptable):
https://ibb.co/444D8X5
Here is a picture of same WPF application on my PC (Unacceptable):
https://ibb.co/mvVHT9s
Any clue why this is happening? Looks like the characters moved a couple pixels down. Thanks in advance.
So the reason your font doesn't appear at runtime is because it is not actually installed on your machine. Windows doesn't know where to find it so it goes to a default font. You should embed the font within the application.
See this post
The Windows Forms code generated by Visual Studio when modified by the designer is not the same if I develop of Windows 8.1 than if I develop in Windows 10. This will result in all my sizes to be increased by a factor close to 1.5 (from Windows 8 to Windows 10).
This might look like an autoscale in order to fit the screen resolution. The problem is that a lot of my code depends heavily on the size and thus the impact is way more than just a "resize" of my whole screen. The generated code also add some margin and padding.
Is there a way to disable all these OS related changes when I modify the code?
I'm using Visual Studio 2013/2015 and my operating system is Windows 10. I would like to know why my WinForms controls look so flat. I have both enabled and disabled EnableVisualStyles. Perhaps this is a Windows 10 issue? Why would these controls be lacking a 3D look and feel?
Thanks much,
The windows 10 theme itself is very flat, and winforms adopts the visual style of whatever version of windows you are running.
So you aren't doing anything wrong, that is just how windows 10 UI elements look.
If you were to run your application on windows 7, it would look more 3D.
Ok, I am aware of developing high dpi applications in WinForms and WPF, but while testing some features in Windows8, I stumbled upon something weird.
I have a WinForms application with AutoScalingMode set to DPI. The form has a bunch of labels. All the labels' font units are measured in points but one (the red label which reads "This text block is special. Its size is 18px"), as its size is set to 18px and not pt.
I ran the application in Windows 7 as well as Windows 8.
Windows 7 does not auto scale this (the red one) label as expected but Windows 8 auto scales the same label!
What could be the issues? Is there a documented statement from Microsoft stating that Auto Scaling set to None won't work in Windows 8?
Okay, I guess I found the reason. I will have to disable the DWM settings to "Disable display scaling on high DPi settings". If I do so, then it is not scaling the text in Windows 8.
But I did not have to do this in Windows 7 and still it works fine! Wondering why..!
I am developing a C# application with .NET Framework 2.0.
The problem is, that on my client's PC, the controls get expanded, layout changes (positions of the controls gets changed), sometimes buttons get missed entirely. It happens even on Forms with 2-3 TextBoxes, 2-3 Buttons and some Labels. I tried a lot of investigations. I tried to show a message in the form's resize event. But it doesn't get called. After digging a bit more, it seemed that in Designer.cs file even though ResumeLayout (false) is being called for the form, but this causes the the expansion/disposition of the controls.
My Client is using Windows XP professional on his Dell laptop. He is able to reproduce the issue on other laptops with Windows XP professional. But not in other OSes (like Windows XP Home or Windows Vista). In my desktop with Windows XP professional, it is not reproducible.
How can this issue be resolved?
Are you sure it has anything to do with the OS? It sounds more like a dpi issue. 'Normal' is 96 dpi. If the form was designed at 96 dpi, it would probably look different at a different setting.
See this article for how to check/change the dpi settings in XP.
Edit: I forgot to mention that you can use the TableLayoutPanel Control to layout your form. Using the auto-sizing capabilities will help keep things looking 'normal' at any dpi setting.
It's probably due to the DPI setting in Windows XP.
If you're using the standard (96) DPI setting, but they're setup using a alternative one (ie: 120), it often will mess up layouts of controls.
The "right" way to handle this is to try to automatically build your layouts using layout elements that can resize as needed. This is difficult in Windows Forms (and one of the things WPF fixes).