-1

I have an old application that uses SkinFramework. The project is working great except when I upgrade the .NET Framework to 4.5 or higher (.NET 4 works great). .NET Framework 4.6 to the right and .NET Framework 4 to the left

Notice the white border around the form to the left. This is especially ugly when resizing a window .NET Framework 4.6 top and .NET Framework 4 bottom

I understand that the project is no longer maintained, but does anyone have an idea on how to solve the problem? What changed between the two .NET version that caused this?

Best Regards

Sondre

1 Answers1

1

From .NET framework 4 to 4.5 Microsoft changed from using Windows subsystem version 4 to version 6. This affected the way some of the form parameters were calculated. For instance, running the SkinFramework.Test project with .Net framework 4 the SystemInformation.FrameBorderSize property (used in FormExtenders.cs::GetBorderSize()) returns a value of (8, 8), whereas using the .Net framework 4.5 this same property returns a value of (4, 4). This leads to the SkinFramework drawing things slightly off from where they're expected.

Here are some relevant links that describe the issue:

Form height/width changes in .Net Framework 4.5

Similar issue with SystemInformation.FrameBorderSize

Another similar issue

As they mention in the first link there are two options for fixing the issue.

1) Change the source code to account for the differences.

2) The easier option would be to specify subsystem version 4.00. You can either add <SubsystemVersion>4.00</SubsystemVersion> to the <PropertyGroup> section of your project file. Or use the /subystemversion:4.00 compiler switch. I have done this and verified that it fixes the problem.

gunnerone
  • 3,566
  • 2
  • 14
  • 18