Posted 1 January 2019, 9:09 am EST - Updated 30 September 2022, 4:48 am EST
In a high (200%) dpi environment, the spread looks great, but the row & column resize pointers are not scaled correctly.
Spread
Excel
Forums Home / Spread / Spread for WinForms
Posted by: kbj on 1 January 2019, 9:09 am EST
Posted 1 January 2019, 9:09 am EST - Updated 30 September 2022, 4:48 am EST
In a high (200%) dpi environment, the spread looks great, but the row & column resize pointers are not scaled correctly.
Spread
Excel
Posted 1 January 2019, 9:10 am EST
oops pictures reversed
Posted 1 January 2019, 7:06 pm EST
Hi,
We’ve escalated this issue to the development team [Internal Tracking ID: 268768].
We’ll update this thread as soon as we get any information from them.
Regards,
Jitender
Posted 25 June 2019, 12:45 am EST - Updated 30 September 2022, 4:48 am EST
Hi Jitender
I downloaded latest SP1 for spread and now default cursors are too big when viewed in a high DPI environment:
Posted 25 June 2019, 6:34 pm EST
Hello,
Sorry to mention that I am not able to reproduce the issue with 200% DPI. Could you please share the DPI and screen resolution.
Thanks.
Posted 27 June 2019, 12:31 am EST
Here’s how to reproduce the “too large” cursor. (note that this fixes the “tiny” column/row resize cursors.)
form1 code:
Public Class Form1
End Class
Public Module moduleGeneral
'*make app dpi aware*
<STAThread>
Public Sub Main()
#Region "dpi"
If Environment.OSVersion.Version.Major >= 6 Then
SetProcessDPIAware()
End If
Application.EnableVisualStyles()
Application.SetCompatibleTextRenderingDefault(False)
#End Region
'load main form
Dim f As New Form1
Application.Run(f)
End Sub
<Runtime.InteropServices.DllImport("user32.dll")>
Public Function SetProcessDPIAware() As Boolean
End Function
End Module
Form 1 designer code:
<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _
Partial Class Form1
Inherits System.Windows.Forms.Form
'Form overrides dispose to clean up the component list.
<System.Diagnostics.DebuggerNonUserCode()> _
Protected Overrides Sub Dispose(ByVal disposing As Boolean)
Try
If disposing AndAlso components IsNot Nothing Then
components.Dispose()
End If
Finally
MyBase.Dispose(disposing)
End Try
End Sub
'Required by the Windows Form Designer
Private components As System.ComponentModel.IContainer
'NOTE: The following procedure is required by the Windows Form Designer
'It can be modified using the Windows Form Designer.
'Do not modify it using the code editor.
<System.Diagnostics.DebuggerStepThrough()> _
Private Sub InitializeComponent()
Dim resources As System.ComponentModel.ComponentResourceManager = New System.ComponentModel.ComponentResourceManager(GetType(Form1))
Me.FpSpread1 = New FarPoint.Win.Spread.FpSpread(FarPoint.Win.Spread.LegacyBehaviors.None, CType(resources.GetObject("resource1"), System.IO.MemoryStream))
Me.FpSpread1_Sheet1 = Me.FpSpread1.GetSheet(0)
CType(Me.FpSpread1, System.ComponentModel.ISupportInitialize).BeginInit()
Me.SuspendLayout()
'
'FpSpread1
'
Me.FpSpread1.SpreadScaleMode = FarPoint.Win.Spread.ScaleMode.ZoomDpiSupport
Me.FpSpread1.Dock = System.Windows.Forms.DockStyle.Fill
Me.FpSpread1.Font = New System.Drawing.Font("Calibri", 11.0!)
Me.FpSpread1.Location = New System.Drawing.Point(0, 0)
Me.FpSpread1.Name = "FpSpread1"
Me.FpSpread1.Size = New System.Drawing.Size(800, 450)
Me.FpSpread1.TabIndex = 0
'
'Form1
'
'Me.AutoScaleDimensions = New System.Drawing.SizeF(12.0!, 25.0!)
'Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
Me.AutoScaleDimensions = New System.Drawing.SizeF(96.0F, 96.0F)
Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi
Me.ClientSize = New System.Drawing.Size(800, 450)
Me.Controls.Add(Me.FpSpread1)
Me.Name = "Form1"
Me.Text = "Form1"
CType(Me.FpSpread1, System.ComponentModel.ISupportInitialize).EndInit()
Me.ResumeLayout(False)
End Sub
Friend WithEvents FpSpread1 As FarPoint.Win.Spread.FpSpread
Friend WithEvents FpSpread1_Sheet1 As FarPoint.Win.Spread.SheetView
End Class
app.config code:
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.2" />
</startup>
<System.Windows.Forms.ApplicationConfigurationSection>
<add key="DpiAwareness" value="PerMonitorV2"/>
<!-- Uncomment each value to disable the fixes one by one. -->
<!--
<add key="Form.DisableSinglePassScalingOfDpiForms" value="true"/>
<add key="ToolStrip.DisableHighDpiImprovements" value="true"/>
<add key="CheckedListBox.DisableHighDpiImprovements" value="true"/>
<add key="MonthCalendar.DisableHighDpiImprovements" value="true"/>
<add key="AnchorLayout.DisableHighDpiImprovements" value="true"/>
<add key="DataGridView.DisableHighDpiImprovements" value="true"/>
-->
</System.Windows.Forms.ApplicationConfigurationSection>
</configuration>
Let me know if you have any problem reproducing the bug. I do have a workaround that creates all the cursors for the spread on the fly, but it seems the control should work correctly “out of the box”
-Kingman
Posted 27 June 2019, 9:20 pm EST
Hi Kingman,
We’ve reported this as a bug [Internal Tracking ID: 273689].
I’ll let you know when a fix is available.
Regards,
Jitender
Posted 12 August 2019, 6:16 pm EST
Hi,
This issue has been fixed in the latest release (Spread SP2).
You can download the latest builds from here:
https://www.grapecity.com/download/spreadnet
Regards,
Jitender