What is the difference between picturebox1.width and picturebox1.client.width? RRS feed

  • Question

  • Hi,

    What is the difference between picturebox1.width  and picturebox1.client.width?

    Hany Metry

    Tuesday, November 19, 2019 11:27 AM


  • Hello,

    Right from Microsoft docs

    The client area of a control is the bounds of the control, minus the nonclient elements such as scroll bars, borders, title bars, and menus. The SetClientSizeCore method is called to set the ClientSize property. The ClientSize property is not always changed through its set method so you should override the SetClientSizeCore method to ensure that your code is executed when the ClientSize property is set.

    If I were to place a border on a PictureBox we have less space within the confines of the picture box canvas as per below.

    Please remember to mark the replies as answers if they help and unmarked them if they provide no help, this will help others who are looking for solutions to the same or similar problem. Contact via my Twitter (Karen Payne) or Facebook (Karen Payne) via my MSDN profile but will not answer coding question on either.

    NuGet BaseConnectionLibrary for database connections.

    profile for Karen Payne on Stack Exchange

    • Marked as answer by Morgan Mosa Tuesday, November 19, 2019 11:51 AM
    Tuesday, November 19, 2019 11:39 AM