NewTreeView.cs

(开头部分) 3KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

using System;
using System.Collections.Generic;
using System.Drawing;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace mind
{
    public interface NodeTextBox
    {
        void btnTextBox_KeyDown(object sender, KeyEventArgs e);
    }
    public class NewTreeView : TreeView
        {
            private bool isToggleIcon;//是否是切换图标模式 
            protected Font STFont;//二级和三级节点的字体  
            public bool IsToggleIcon
            {
                get
                {
                    return isToggleIcon;
                }
                set
                {
                    isToggleIcon = value;
                }
            }

            public NewTreeView()
            {
                this.isToggleIcon = true;
                this.ShowLines = false;
                this.FullRowSelect = true;
                this.ShowPlusMinus = true;
                this.ItemHeight = 32;
                //this.Control.Add();
                this.Font = new Font("宋体", 16, FontStyle.Bold);
                this.STFont = new Font("宋体", 14, FontStyle.Regular);
        }

            protected override void OnAfterSelect(TreeViewEventArgs e)
            {
                //节点选中后触发    
                if (false == isToggleIcon)//图标分级效果
                {
                    e.Node.SelectedImageIndex = e.Node.Level;//当前节点
                    TreeNodeCollection nodes = e.Node.Nodes;
                    foreach (TreeNode node in nodes)
                    {
                        node.ImageIndex = node.Level; //子节点                  
                    }
                }
            }

            protected override void OnAfterExpand(TreeViewEventArgs e)
            {
                //节点展开后触发
后面还有 42 行代码,解锁后查看完整代码

24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明

AI 解读 AI

登录后可用,每次 10 算力,解读结果公开显示在下面。

还没有人解读过这个文件。