为什么树视图节点中的一些字母是不可见的? [英] why a few number of letters in treeview nodes is invisible?

查看:55
本文介绍了为什么树视图节点中的一些字母是不可见的?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


我有一个填充数据库数据的树视图。在运行时,父节点中的几个字母是不可见的,但是子节点是正确的。示例



+ First Par(这是:第一父母)

+ Second Pare(这是:第二父母)

- 第三杆(这是:第三位父母)

第三位家长 - 第一个孩子









我做什么用?!!

谢谢



编辑:

我的代码:



DataTable dt = GetRecords(查询) ;



//parent.Nodes.Clear();



foreach(DataRow dr in dt。行)

{

TreeNode tn = new TreeNode();



tn.Name = dr [ groups]。ToString();



tn.Text = dr [text]。ToString();



tn.ForeColor = Color.Green;

tn.NodeFont = new Font(Times New Roman,11,FontStyle.Regular);



treevi ew1.Nodes.Add(tn);



}



i发现问题在于字体在变化,当这一行被评论显示是好的。

这个问题只在父母被检测到,如果我使用这个代码获取子节点,没有检测到问题(字体改变)。



在设计中我将treeview1字体设置为Times New Roman大小为10,如果有帮助!

Hi I have a treeview that filling with data from database. In the runtime a few letters in the parent nodes are invisible but childs are correct. Example

+ First Par (This is: First Parent)
+ Second Pare (This is: Second Parent)
- Third Par (This is: Third Parent)
Third Parent - First Child
.
.
.

What I do?!!
Thanks


my code:

DataTable dt = GetRecords(query);

//parent.Nodes.Clear();

foreach (DataRow dr in dt.Rows)
{
TreeNode tn = new TreeNode();

tn.Name = dr["groups"].ToString();

tn.Text = dr["text"].ToString();

tn.ForeColor = Color.Green;
tn.NodeFont = new Font("Times New Roman", 11, FontStyle.Regular);

treeview1.Nodes.Add(tn);

}

i found that problem is in the font changing, when this line is commented displaying is ok.
this problem only in parents was detected and if i using this code for fetching childs nodes, no problem detected (with font changing).

in the disign i set the treeview1 font on "Times New Roman" size 10, if help!

推荐答案

这可以发给树视图控件的宽度有限。
this could be for limited width issued to treeview control.


这篇关于为什么树视图节点中的一些字母是不可见的?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆