Why Do My WinForms Controls Look Flat? - c#

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.

Related

Why does my WPF application font look different on my PC?

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

Windows Forms compatibility in Windows 8.1 - Windows 10

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?

My program's GUI is messed up in Windows 8

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?

WinForms Use Windows Aero Theme when Windows Theme is set to Classic

I was wondering if someone found a way to keep a Windows form Application designed with the Windows 7 Aero theme to keep the Aero theme when the theme on the computer is switched to Classic. When a user switches there theme to classic all of the controls look like pre windows xp style. Thanks for any help anyone can provide
Corey's comment is spot-on, however programs still shouldn't look "bad" when in classic mode (Office 2003 looks better, actually), so I suggest making some visual tweaks to your program :)
Can you post a screenshot so we can provide some guidance?
Note that in future this will be a non-issue because under Windows 8 themes cannot be disabled.

C# - Layout problem on Windows XP professional

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).

Categories

Resources