filetreenode.cs

来自「这是用C#编的一个简单的电子日记本软件」· CS 代码 · 共 59 行

CS
59
字号
using System ;
using System.Windows.Forms ;
namespace CS_Note1
{
	/// <summary>
	/// 
	/// </summary>
	public class FileTreeNode : TreeNode
	{
		private TreeNodeStyle  _NoteStyle ;
		private string         _FileOrFolderName ;

		public FileTreeNode()
		{
			this._NoteStyle = TreeNodeStyle.File ;
			this.Text = @"???" ;
		}

		public FileTreeNode (TreeNodeStyle notestylt, string txt)
		{
			this.NoteStyle = notestylt ;
			this.Text = txt ;
			if (notestylt == TreeNodeStyle.File)
			{
				this.ImageIndex = (int)TreeImgIndex.txt ;
				this.SelectedImageIndex = (int)TreeImgIndex.txt ;
			}
			else if (notestylt == TreeNodeStyle.Folder)
			{
				this.ImageIndex = (int)TreeImgIndex.ClosedFolder ;			
			}
		}

		public TreeNodeStyle  NoteStyle
		{
			get
			{
				return this._NoteStyle ;
			}
			set
			{
				_NoteStyle = value ;
			}
		}

		public string FileOrFolderName
		{
			get
			{
				return this._FileOrFolderName ;
			}
			set
			{
				_FileOrFolderName = value ;
			}
		}
	}
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?