SVN-Revision: r825
This commit is contained in:
cyf
2025-07-02 01:56:09 +00:00
parent 76e2ade6fb
commit 4453dddb02
+2 -28
View File
@@ -882,6 +882,7 @@ namespace Lskj.Control
this.gcMain = new TreeBandedGridControlEx() { Expansion = SysModel.TreeTableExpand };
this.gcMain.Model = this.Model;
this.gcMain.SysModel = this.SysModel;
(this.gcMain as TreeBandedGridControlEx).moduleModel = this.SysModel;
this.gcMain.Dock = DockStyle.Fill;
if (this._gridColumns.Rows.Count == 0 && !string.IsNullOrWhiteSpace(SysModel.TreeKeyFieldName) && !string.IsNullOrWhiteSpace(SysModel.TreeParentFieldName))
{
@@ -5575,31 +5576,4 @@ namespace Lskj.Control
// 获取字体和最大宽度
Document document = richEdit.Document;
Font font = richEdit.Font;
int maxWidth = richEdit.ClientSize.Width - richEdit.Padding.Horizontal;
// 获取前3行文本
string[] lines = richEdit.Text.Split(new[] { Environment.NewLine }, StringSplitOptions.None);
int lineCount = Math.Min(4, lines.Length);
string firstThreeLines = string.Join(Environment.NewLine, lines.Take(lineCount));
// 创建StringFormat
StringFormat format = new StringFormat(StringFormat.GenericTypographic);
format.FormatFlags |= StringFormatFlags.MeasureTrailingSpaces;
// 测量文本高度
using (Graphics g = richEdit.CreateGraphics())
{
SizeF textSize = g.MeasureString(
firstThreeLines,
font,
maxWidth,
format
);
return (int)Math.Ceiling(textSize.Height);
}
}
}
}