Treeview控件

 题目要求:

         创建一个如下的窗体,并在窗体上放置一个标签、一个treeviw控件。窗体打开时,动态为treeviw控件添加节点,选择某个节点后,标签上显示所选内容。


输入代码:

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

namespace treeview
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void treeView1_AfterSelect(object sender, TreeViewEventArgs e)
        {
            label1.Text = e.Node.Text;
        }
    }
}

运行截图:



总结:

基本属性完成


V5.3.0: (04 Jan 2014) - Fix for issue #159 (Cursor missing in edit with non-standard DPI): Ensuring a minimum size of the edit control - Fixed issue #403: Declare TVTGetNodeProc as reference to procedure (for D2009+) - Fixed issue #402: TVTEdit.CNCommand discard all notification except EN_UPDATE due to missing inherited - Corrected fix for issue #376 (Incorrect selection paint when toGridExtensions is included in the MiscOptions) - Fixed issue #401: OnNodeClick event doesn't trigger in some case, coFixed set for a column - Modified #316 (concerning r498). The fix for #316 will only be applied in case toMultiSelect is set. If toMultiSelect is not set we can start a drag anywhere in the row. - ContentToHTML() and ContentToRTF() now return a string of type RawByteString. Because the generated strings are pre-encoded in UTF-8, the previous type AnsiString caused problems in Delphi 2009+ e.g. when this string was written using the VCL TStreamWriter class. The helper class TBufferedAnsiString therefore uses RywByteString now as type too. - Fixed issue #399: EditDelay not working - Fixed issue #400: AltGr+A does not behave as expected for foreign keyboard layouts in VTEdit - Fixed issue #388: VirtualStringTree with toFixedIndent causes range check error - Edit box when editing a node in a tree with toFixedIndent now has the correct indent - Fixed issue #392: Now ensuring that MeasureItemHeight() is only called from the main thread. - Fixed #383: Clear vsHasChildren for a node without children even if the children count didn't change. - Fixed #377: Wrong font (size, etc) in TargetCanvas in MeasureItem for first node - Fixed issue #398 (hoAutoResize causes DFM designer to be modified after loading) by calling TControl.Updating()/Updated() in AdjustAutoSize() - Preventing possible AV in TBaseVirtualTree.FontChanged() - Fixed 32Bit Integer overflows in Win64 build in TBufferedAnsiString.
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

潇潇雨歇_

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值