Dan*_*ord 2 c# treeview winforms
我在我的通知应用程序中使用树视图。当我加载包含大量文本的节点时,文本会被截断为 12 个字符。我该如何防止这种情况发生?
使用的字体:Microsoft Sans Serif,12pt,style=Bold
我尝试过使用普通字体,但没有成功。
这是我的代码(我已经用另一个类覆盖了树节点):
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Diagnostics;
namespace Repetrel
{
public class ActionObjectTreeNode: TreeNode
{
public string fileName = null;
private ActionObject actionObject = new ActionObject();
public string Text {
get { return base.Text; }
set {
if (value.Equals(base.Text) == false && base.Text!="")
{
Trace.WriteLine("error detected");
}
base.Text = value;
}
}
public ActionObject ACTIONOBJECT
{
get
{
return actionObject;
}
set
{
actionObject = value;
if (value == null && TREENODETYPE != TreeNodeType.Project) {
System.Diagnostics.Trace.WriteLine("null assigned to actionobject");
}
}
}
public TreeNodeType TREENODETYPE { get; set; }
public TreeNodeType LOCKEDNODETYPE { get; set; }
public DrillActionGroup ACTIONPROPERTIES { get; set; }
public ActionObjectTreeNode()
{
}
public ActionObjectTreeNode(string text)
{
this.Text = text;
}
public ActionObjectTreeNode(ActionObject actionObject)
{
if (actionObject != null)
{
this.Text = actionObject.TEXT;
this.ACTIONOBJECT = actionObject;
}
}
public bool guidMatch(string _guid)
{
return ACTIONOBJECT.getGuid().Equals(_guid);
}
}
Run Code Online (Sandbox Code Playgroud)
}
| 归档时间: |
|
| 查看次数: |
2001 次 |
| 最近记录: |