分辨率为4K时,table的行、列字体变粗变大的问题
分辨率为4K时,table的行、列字体变粗变大的问题。背景是:初始化FpSpread时使用的是FarPoint.Win.Spread.LegacyBehaviors.None ,如下:
this.fpSpread = new FarPoint.Win.Spread.FpSpread(FarPoint.Win.Spread.LegacyBehaviors.None);
和分辨率没有关系,先确认一下,你设置的屏幕放大比例是多少,设置的大了,自然是整体都变大了,包括你其他显示的内容
你可以调试一下。字体是变大,但列头和行头 是非常粗且字体变得更大 所以我需要先和你确认你那边的设置,如果放大比例仍然是100%的话,肯定不会有这个问题
我这里能设置的最大比例是175%,显示出来也看不出什么问题
调试一下分辨率测试一下了 设置的本身已经是屏幕支持的最大分辨率了。我这里没有4k屏幕,但是你提到的这个问题,如果要重现,肯定还是和屏幕缩放有关,4K如果是小屏幕的话一般可能会是200%
我这边笔记本默认是150%
你得给我一个重现问题的demo,我估计是和程序适应高分辨率做的其他设置有关系,否则你可以参考我给你的截图175%下面也不会有任何问题
Richard.Ma 发表于 2023-11-27 18:07
设置的本身已经是屏幕支持的最大分辨率了。我这里没有4k屏幕,但是你提到的这个问题,如果要重现,肯定还是 ...如下图,列头和行头 字体非常大。
麻烦给一个重现问题的demo,我这边没法重现你截图中的情况,如上所说,猜测应该是和程序中的其他设置有关系 Richard.Ma 发表于 2023-11-28 13:56
麻烦给一个重现问题的demo,我这边没法重现你截图中的情况,如上所说,猜测应该是和程序中的其他设置有关系
private void InitializeComponent()
{
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(TableSpread));
this.fpSpread = new FarPoint.Win.Spread.FpSpread(FarPoint.Win.Spread.LegacyBehaviors.None); //, resources.GetObject("resource1"));
this.fpSpreadSheet = new SheetView(); // this.fpSpread.GetSheet(0);
this.splitContainer = new System.Windows.Forms.SplitContainer();
this.tableLayout = new TableLayoutPanel();
this.trackBar = new System.Windows.Forms.TrackBar();
this.prevLabel = new System.Windows.Forms.Label();
this.nextLabel = new System.Windows.Forms.Label();
this.showLabel = new System.Windows.Forms.Label();
((System.ComponentModel.ISupportInitialize)(this.fpSpread)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.fpSpreadSheet)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.splitContainer)).BeginInit();
this.splitContainer.SuspendLayout();
this.splitContainer.Panel1.SuspendLayout();
this.splitContainer.Panel2.SuspendLayout();
this.tableLayout.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.trackBar)).BeginInit();
this.SuspendLayout();
this.fpSpread.AccessibleDescription = "Book1, Sheet1, Row 0, Column 0";
this.fpSpread.BackColor = System.Drawing.Color.Transparent;
this.fpSpread.BorderStyle = System.Windows.Forms.BorderStyle.None;
this.fpSpread.Dock = System.Windows.Forms.DockStyle.Fill;
this.fpSpread.Font = new System.Drawing.Font("Arial", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel);
this.fpSpread.Location = new System.Drawing.Point(0, 0);
this.fpSpread.Name = "fpSpread";
//this.fpSpread.ScrollBarMaxAlign = false;
this.fpSpread.ScrollBarTrackPolicy = FarPoint.Win.Spread.ScrollBarTrackPolicy.Both;
this.fpSpread.ScrollTipPolicy = FarPoint.Win.Spread.ScrollTipPolicy.Both;
this.fpSpread.Sheets.Add(this.fpSpreadSheet);
this.fpSpread.ActiveSheet = this.fpSpreadSheet;
////this.fpSpread.Sheets.AddRange(new FarPoint.Win.Spread.SheetView[] {
////this.fpSpreadSheet});
////this.fpSpread.Size = new System.Drawing.Size(1455, 973);
this.fpSpread.AutoSize = true;
this.fpSpread.StatusBarVisible = false;
this.fpSpread.TabIndex = 0;
this.fpSpread.TabStripPolicy = FarPoint.Win.Spread.TabStripPolicy.AsNeeded;
this.fpSpread.VerticalScrollBarPolicy = FarPoint.Win.Spread.ScrollBarPolicy.AsNeeded;
this.fpSpread.HorizontalScrollBarPolicy = FarPoint.Win.Spread.ScrollBarPolicy.AsNeeded;
this.fpSpreadSheet.Reset();
this.fpSpreadSheet.SheetName = "Sheet1";
this.fpSpreadSheet.GrayAreaBackColor = System.Drawing.Color.Transparent;
this.fpSpreadSheet.OperationMode = FarPoint.Win.Spread.OperationMode.ExtendedSelect; // 禁用左上角全选
this.fpSpreadSheet.RowHeader.DefaultStyle.BackColor = System.Drawing.Color.Empty;
this.fpSpreadSheet.RowHeader.DefaultStyle.ForeColor = System.Drawing.Color.Red;
this.fpSpreadSheet.RowHeader.DefaultStyle.Locked = false;
this.fpSpreadSheet.SelectionPolicy = FarPoint.Win.Spread.Model.SelectionPolicy.MultiRange;
this.fpSpreadSheet.SelectionUnit = FarPoint.Win.Spread.Model.SelectionUnit.Row;
this.fpSpreadSheet.FrozenColumnCount = 0;
} afei_liuge 发表于 2023-11-28 14:16
private void InitializeComponent()
{
System.ComponentModel.ComponentResource ...
就设置了这些
页:
[1]
2