none
Bug : Same property "SystemInformation.FrameBorderSize.Width" Different value in Framework4.6.1 and Framework 4.0 RRS feed

  • Question

  • I Was using .Net framework 4.0 and have used in my application  SystemInformation.FrameBorderSize.Width property it was returning 8 pixel. using this am calculating the border size in my application to support different themes.

    Recently have migrated in to 4.6.1 Framework now am facing issue and after analyzing the issue realize that the SystemInformation.FrameBorderSize.Width is returning 4 pixel.

    I couldn't find any document for this change and also please let me know is there any alternative is there to get same value equivalent to 4.0 framework.

    Regards

    Santhosh

    Wednesday, February 24, 2016 4:24 AM

Answers

  • Hi Santhosh,

    I also tested on my side. Looks the result is same as yours.

    Here is my screen capture.

     private void button1_Click(object sender, EventArgs e)
            {
                this.label1.Text = SystemInformation.FrameBorderSize.Width.ToString();
            }

    Please report this issue to Connect where you can contact MS engineer to help you fix it. 

    By the way, if you finish to submit this issue, please remember to post the link here, I will help you vote it. Thanks.

    Best regards,

    Kristin


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Thursday, February 25, 2016 8:55 AM

All replies

  • I Was using .Net framework 4.0 and have used in my application  SystemInformation.FrameBorderSize.Width property it was returning 8 pixel. using this am calculating the border size in my application to support different themes.

    Recently have migrated in to 4.6.1 Framework now am facing issue and after analyzing the issue realize that the SystemInformation.FrameBorderSize.Width is returning 4 pixel.

    I couldn't find any document for this change and also please let me know is there any alternative is there to get same value equivalent to 4.0 framework.

    Regards

    Santhosh


    Tuesday, February 23, 2016 11:27 AM
  • Hi Santhosh Kimara,

    Developers debugging existing WinForms applications (targeting .NET 4.0 or older) or upgrading those applications to target .NET 4.5 (or newer) may notice changes in the Height and Width of some Forms.

    See the detail information and workaround in following link.
    https://support.microsoft.com/en-us/kb/2877623

    Best Regards,
    Li Wang


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Wednesday, February 24, 2016 2:31 AM
    Moderator
  • Thanks for your information,

    The problem is not in Debugging the application even we are getting the different value of this property in release mode also. this is impacting in my further calculation of border size of my application.

    Thanks in advance.

    Regards

    Santhosh

    Wednesday, February 24, 2016 3:26 AM
  • [...]please let me know is there any alternative is there to get same value equivalent to 4.0 framework.


    Try this (inside a form):

        int border_width = ( Bounds.Width - ClientRectangle.Width ) / 2;

    Wednesday, February 24, 2016 8:28 PM
  • Hi Santhosh,

    I also tested on my side. Looks the result is same as yours.

    Here is my screen capture.

     private void button1_Click(object sender, EventArgs e)
            {
                this.label1.Text = SystemInformation.FrameBorderSize.Width.ToString();
            }

    Please report this issue to Connect where you can contact MS engineer to help you fix it. 

    By the way, if you finish to submit this issue, please remember to post the link here, I will help you vote it. Thanks.

    Best regards,

    Kristin


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Thursday, February 25, 2016 8:55 AM