Posted 3 April 2022, 6:54 am EST - Updated 3 October 2022, 10:19 pm EST
Hi There,
I’ having some troubles with C1TrueDBGrid’s PrintInfo when Windows 10’s text size is set to 125%. Even though the Grid’s rows and cells are rendered correctly the cell texts aren’t resized and re-positioned accordingly. Please see both screenshots attached.
Here’s what I do:
// grid
C1TrueDBGrid _myGrid = (C1TrueDBGrid)sender;
// resize columns
for (int i = 0; i <= _myGrid.Columns.Count - 1; i++)
_myGrid.Splits[0].DisplayColumns[i].AutoSize();
// extend right column
_myGrid.ExtendRightColumn = false;
// preview
_myGrid.PreviewInfo.ZoomFactor = 100;
_myGrid.PreviewInfo.Size = System.Windows.Forms.SystemInformation.WorkingArea.Size;
_myGrid.PreviewInfo.Caption = sPageHeader;
// printinfo
PrintInfo _myInfo = _myGrid.PrintInfo;
// measurements
_myInfo.MeasurementDevice = PrintInfo.MeasurementDeviceEnum.Screen;
// pagesettings
_myInfo.PageSettings.Margins.Left = 25;
_myInfo.PageSettings.Margins.Right = 25;
_myInfo.PageSettings.Margins.Top = 25;
_myInfo.PageSettings.Margins.Bottom = 25;
_myInfo.PageSettings.Landscape = bLandscape;
// pageheader
_myInfo.PageHeader = sPageHeader + "\t\t Seite \\p von \\P";
_myInfo.PageHeaderStyle.Font = new Font(_myInfo.PageHeaderStyle.Font, FontStyle.Bold | FontStyle.Italic);
// pagefooter
_myInfo.PageFooter = sPageFooter;
_myInfo.PageFooterStyle.Font = new Font(_myInfo.PageFooterStyle.Font, FontStyle.Bold | FontStyle.Italic);
_myInfo.PageFooterHeight = 100;
// kopf auf jeder seite
_myInfo.RepeatGridHeader = true;
_myInfo.RepeatColumnHeaders = true;
// ausdrucken
_myInfo.PageSettings.PrinterSettings.Copies = 1;
_myInfo.PageSettings.PrinterSettings.Collate = true;
_myInfo.UseGridColors = true;
_myInfo.PrintPreview();
Please advise. Thanks in advance.