columns and rows don't change, when dpi settings change

Posted by: alexr on 8 September 2017, 2:37 pm EST

  • Posted 8 September 2017, 2:37 pm EST

    I'm using Spread for Windows Forms 5 for Framework 3.5 with Visual Studio 2010 (Visual Basic) with .NET Framework 4.
    I have the following problem:
    In my windows I use dpi settings of 96 dpi (100%). I create a form with a fpSpread, compile the exe file and everything is fine. Then I change my windows settings to 120dpi (125%). When I start my application now, the spread has changed his height, width and the fontsize according to the dpi settings like all the other controls on the form including the form itself, but the rows and columns of the spread remain to their original size. You can reproduce this behaviour with one single spread without any modifications except setting columcount to 5 (for example) and adjust the width of the spread, so that all 5 columns fit exactly into the spread. After changing the dpi settings to 120dpi you will see, that the width of the spread has grown, but the columns didn't, so you can see some empty space between the fifth column and the right border/vertical scrollbar. In addition the text doesn't fit into the cells anymore, because the textsize has grown, too.

    Please give me some insight/help.
    Many thanks in advance.
    Alex

  • Replied 8 September 2017, 2:37 pm EST

    Hi Paul,

    thanks for your answer, but the problem isn't solved yet. The columns and rows don't scale/grow, no matter, whether I use default values (20 for rowheight and 60 for colwidth) or whether I change the sizes in the spread designer or by code in form_load.The spread is not databound.

    Did you try this with an empty spread like I described  in my first post?  I can reproduce this behaviour with an empty spread, which I only dragged from the toolbox on a form. Nothing else changed, no data entered. I put a button on the form and on a click on this button, the height/width of the spread and the height of the first row and the width of the first column will be written to a listbox. When I compare these values before and after I changed my DPI, I can read from the listbox, that the height and width of the entire spread has been changed but the height of the row and the width of the column are still 20 and 60.

    Any further ideas? Or should I report this as a possible bug?

    Thanks.
    Alex

  • Replied 8 September 2017, 2:37 pm EST

    Column width and row height is set to a certain amount of pixels (default is 20 pixels high by 60 pixels wide), changing the dpi should change the size of a pixel and so the row height and column width. By default if your spread is bound to a data source then the column width and row height will be determined by the data in the bound fields, unless you have turned off the DataAutoSizeColumns property., the Spread can also determing the column width and row height if you use the GetPreferredColumnWidth and GetPreferredRowHeight methods. I tried to test this and it seemed that after setting the column width and row height to specific values that they scaled with the rest when I changed my DPI so I'm wondering if your spread is bound or what method you are using to set these properties.
  • Replied 8 September 2017, 2:37 pm EST

    Changing the DPI will not change how many pixels the width and the height of a cell will be, it will change the size of a pixel. The Height will still be 20 pixels and the width 60 pixels unless you set it differently.
  • Replied 8 September 2017, 2:37 pm EST

    Then maybe we are talking about two different things?

    In Windows 7 you can change screen settings to one of these three settings:
    (I'm using a german windows, so I can only guess what the english labels are, sorry.)

    1. smaller - 100%
    2. medium - 125%
    3. greater - 150%

    In Windows XP these settings are slighty different:
    1. normal (96dpi)
    2. big (120dpi)

    If I select a higher setting the effect is the same: Every window and every control in every application will grow in size. This happens with all heights and widths except for the rows and columns in the spread. (In VB6 with Spread 6 I didn't have these problems so I never thougt about this before.)
    In my understanding the settings in Windows XP are confusing, because when I increase dpi (=dots per inch) I would expect, that for my eye everything would appear smaller, but the opposite is the fact.
    Some of my customers use this, because they have big screens and every is to small so they increase the settings.

    However, what else can I try?
    Alex

     

  • Replied 8 September 2017, 2:37 pm EST

    It does appear to be a bug and I have reported it as defect # 99921053 and it should be addressed in the next maintenance release.
  • Replied 8 September 2017, 2:37 pm EST

    Thanks.

    Meanwhile I coded  a workaround, but I would appreciate it, if this could be fixed in the next releases.

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels