Proper CheckBox sizes in High DPI environment

Posted by: kbj on 19 March 2020, 6:02 am EST

  • Posted 19 March 2020, 6:02 am EST

    Using the latest version of the winforms c1inputpanel and c1checkboxes I am unable to get propery sized checkboxes in a high (150%) DPI environment.
    As below:
  • Replied 19 March 2020, 4:20 pm EST

    Hi Kingman,

    Sorry but we can not replicate the issue at our end, please see the attached GIF showing the same.
    If you are doing something else as shown in GIF then please let us know and modify the sample accordingly.

    Regards,
    Prabhat Sharma.
    InputPanelCheckBoxDemo.zip

  • Replied 22 March 2020, 9:54 am EST

    Hi Prabhat,
    Did you include a C1ThemeController on your form (and set theme of the input panel and C1Checkbox)? And are you developing and deploying in the higher DPI?
    That may be causing the issue.
    Kingman
  • Replied 22 March 2020, 7:35 pm EST

    Hi Kingman,

    I have also tried by using C1ThemeController but didn't face any issue too.
    Please let us know the steps that need to be followed to replicate the issue with the stripped-down sample.

    Also, share the DPI level at which you are getting the issue.

    Regards,
    Prabhat Sharma.
  • Replied 23 March 2020, 1:29 am EST

    Hi Prabhat
    Here's a demo. I am developing and running the app at 144 dpi. Remember to set the startup object to sub Main


    tinyCheckBox.zip
    I get:
  • Replied 23 March 2020, 4:32 pm EST

    Hi Kingman,

    Thank you for the sample and we can observe the issue with that so escalated the case to the developers.
    [Internal Tracking ID: 426983]

    Regards,
    Prabhat Sharma.
  • Replied 13 May 2020, 11:42 pm EST

    Prabhat,
    Is this going to be fixed?
    -Kingman
  • Replied 14 May 2020, 12:14 am EST

    Hi Kingman,

    As per the devs, currently it is limitation of c1inputPanel and for the time being you can use the following workaround:

      Public Sub Main()
    'dpi awareness
    If Environment.OSVersion.Version.Major >= 6 Then
    SetProcessDPIAware()
    End If
    Application.EnableVisualStyles()
    Application.SetCompatibleTextRenderingDefault(False)
    'load main form
    Dim f = New Form1
    ' workaround for C1InputPanel
    Dim isi = CType(f.C1InputPanel1, ComponentModel.ISupportInitialize)
    isi.BeginInit()
    Using g = f.C1InputPanel1.CreateGraphics()
    f.C1InputPanel1.DesignScaleFactor = g.DpiX / 96.0F
    End Using
    isi.EndInit()

    Application.Run(f)
    End Sub


    We are forwarding this as an enhancement request to get it added in the control in the future.

    Regards,
    Prabhat Sharma.
  • Replied 14 May 2020, 3:41 am EST

    Hi Prabhat,
    As I pointed out in the first post, changing the design scale factor as per your recommendation above also rescales other graphical components (eg. InputTrackBar) with undesired results. Again, this is not an enhancement for a control to work as it should. I can't believe having tiny check boxes is part of the existing design spec. Also, the above workaround does not address the odd things happening with the C1CheckBox control.
    -Kingman
  • Replied 14 May 2020, 5:15 pm EST

    Hello Kingman,

    >>changing the design scale factor as per your recommendation above also rescales other graphical components &the above workaround does not address the odd things happening with the C1CheckBox control.

    Sorry for the inconvenience.
    I too can observe both the issues at our end and updating the developers for the same and requesting them to get it fixed soon.

    Regards,
    Prabhat Sharma.
Need extra support?

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

Learn More

Forum Channels