diff --git a/README.md b/README.md index 95ea26e..a4b94bd 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,54 @@ # How to filter the tree node based on the node ID in winforms treeviewadv? -This example explains how to filter the tree node based on the node ID in winforms treeviewadv. + +## Filter the node based on NodeID + +In the [TreeViewAdv](https://help.syncfusion.com/cr/windowsforms/Syncfusion.Windows.Forms.Tools.TreeViewAdv.html), [TreeNodeAdv](https://help.syncfusion.com/cr/windowsforms/Syncfusion.Windows.Forms.Tools.TreeNodeAdv.html) can be filtered based on its value by performing the iteration process. The following code example demonstrates the same. + +**C# Code snippet:** + +```C# + +for(int nodeId = 0; nodeId <= 10000; nodeId++) +{ + //Custom node for ID propety + CustomTreeNodeAdv customNode = new CustomTreeNodeAdv(); + customNode.ID = nodeId; + customNode.Text = "Node" + nodeId.ToString(); + this.treeViewAdv1.Nodes.Add(customNode); +} +//Iterates the nodes in the TreeViewAdv +foreach (CustomTreeNodeAdv item in this.treeViewAdv1.Nodes) +{ + //Gets the TextBox value + string textvalue = item.ID.ToString(); + if(this.integerTextBox1.Text == textvalue) + { + //Gets the node by its ID + MessageBox.Show(item.Text); + } +} + +``` + +**VB Code snippet:** + +```VB + +For nodeId As Integer = 0 To 10000 + 'Custom node for ID propety + Dim customNode As New CustomTreeNodeAdv() + customNode.ID = nodeId + customNode.Text = "Node" & nodeId.ToString() + Me.treeViewAdv1.Nodes.Add(customNode) +Next nodeId +'Iterates the nodes in the TreeViewAdv +For Each item As CustomTreeNodeAdv In Me.treeViewAdv1.Nodes + 'Gets the TextBox value + Dim textvalue As String = item.ID.ToString() + If Me.integerTextBox1.Text = textvalue Then + 'Gets the node by its ID + MessageBox.Show(item.Text) + End If +Next item + +``` diff --git a/TreeViewAdvDemo/C#/CustomTreeNodeAdv.cs b/TreeViewAdvDemo/C#/CustomTreeNodeAdv.cs new file mode 100644 index 0000000..07d1cb4 --- /dev/null +++ b/TreeViewAdvDemo/C#/CustomTreeNodeAdv.cs @@ -0,0 +1,29 @@ +using Syncfusion.Windows.Forms.Tools; + +namespace TreeViewAdvNodeId +{ + //Creating custom class + public class CustomTreeNodeAdv : TreeNodeAdv + { + public CustomTreeNodeAdv() + { + //do something + } + + private int m_NodeId; + /// + /// Gets/Sets the Id in TreeNodeAdv + /// + public int ID + { + get + { + return m_NodeId; + } + set + { + m_NodeId = value; + } + } + } +} \ No newline at end of file diff --git a/TreeViewAdvDemo/C#/Form1.Designer.cs b/TreeViewAdvDemo/C#/Form1.Designer.cs new file mode 100644 index 0000000..7b59e1b --- /dev/null +++ b/TreeViewAdvDemo/C#/Form1.Designer.cs @@ -0,0 +1,163 @@ +using Syncfusion.Windows.Forms.Tools; +using Syncfusion.Windows.Forms; +using System.Windows.Forms; + +namespace TreeViewAdvNodeId +{ + public partial class Form1 + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.components = new System.ComponentModel.Container(); + System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Form1)); + this.treeViewAdv1 = new Syncfusion.Windows.Forms.Tools.TreeViewAdv(); + this.groupBox1 = new System.Windows.Forms.GroupBox(); + this.label2 = new System.Windows.Forms.Label(); + this.integerTextBox1 = new Syncfusion.Windows.Forms.Tools.IntegerTextBox(); + this.buttonAdv1 = new Syncfusion.Windows.Forms.ButtonAdv(); + ((System.ComponentModel.ISupportInitialize)(this.treeViewAdv1)).BeginInit(); + this.groupBox1.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.integerTextBox1)).BeginInit(); + this.SuspendLayout(); + // + // treeViewAdv1 + // + this.treeViewAdv1.BackColor = System.Drawing.Color.White; + this.treeViewAdv1.BeforeTouchSize = new System.Drawing.Size(250, 274); + this.treeViewAdv1.Border3DStyle = System.Windows.Forms.Border3DStyle.Flat; + this.treeViewAdv1.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; + this.treeViewAdv1.CanSelectDisabledNode = false; + // + // + // + this.treeViewAdv1.HelpTextControl.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; + this.treeViewAdv1.HelpTextControl.Location = new System.Drawing.Point(0, 0); + this.treeViewAdv1.HelpTextControl.Name = "helpText"; + this.treeViewAdv1.HelpTextControl.Size = new System.Drawing.Size(49, 15); + this.treeViewAdv1.HelpTextControl.TabIndex = 0; + this.treeViewAdv1.HelpTextControl.Text = "help text"; + this.treeViewAdv1.Location = new System.Drawing.Point(25, 39); + this.treeViewAdv1.MetroColor = System.Drawing.Color.FromArgb(((int)(((byte)(22)))), ((int)(((byte)(165)))), ((int)(((byte)(220))))); + this.treeViewAdv1.Name = "treeViewAdv1"; + this.treeViewAdv1.SelectedNodeBackground = new Syncfusion.Drawing.BrushInfo(System.Drawing.Color.FromArgb(((int)(((byte)(22)))), ((int)(((byte)(165)))), ((int)(((byte)(220)))))); + this.treeViewAdv1.ShowFocusRect = false; + this.treeViewAdv1.Size = new System.Drawing.Size(250, 274); + this.treeViewAdv1.Style = Syncfusion.Windows.Forms.Tools.TreeStyle.Metro; + this.treeViewAdv1.TabIndex = 0; + this.treeViewAdv1.Text = "treeViewAdv1"; + // + // + // + this.treeViewAdv1.ToolTipControl.BackColor = System.Drawing.SystemColors.Info; + this.treeViewAdv1.ToolTipControl.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; + this.treeViewAdv1.ToolTipControl.Location = new System.Drawing.Point(0, 0); + this.treeViewAdv1.ToolTipControl.Name = "toolTip"; + this.treeViewAdv1.ToolTipControl.Size = new System.Drawing.Size(41, 15); + this.treeViewAdv1.ToolTipControl.TabIndex = 1; + this.treeViewAdv1.ToolTipControl.Text = "toolTip"; + // + // groupBox1 + // + this.groupBox1.Controls.Add(this.treeViewAdv1); + this.groupBox1.Location = new System.Drawing.Point(34, 40); + this.groupBox1.Name = "groupBox1"; + this.groupBox1.Size = new System.Drawing.Size(311, 349); + this.groupBox1.TabIndex = 1; + this.groupBox1.TabStop = false; + this.groupBox1.Text = "TreeViewAdv"; + // + // label2 + // + this.label2.AutoSize = true; + this.label2.Location = new System.Drawing.Point(425, 116); + this.label2.Name = "label2"; + this.label2.Size = new System.Drawing.Size(98, 13); + this.label2.TabIndex = 5; + this.label2.Text = "Type Node ID here"; + // + // integerTextBox1 + // + this.integerTextBox1.BackGroundColor = System.Drawing.SystemColors.Window; + this.integerTextBox1.BeforeTouchSize = new System.Drawing.Size(141, 20); + this.integerTextBox1.Cursor = System.Windows.Forms.Cursors.IBeam; + this.integerTextBox1.IntegerValue = ((long)(1)); + this.integerTextBox1.Location = new System.Drawing.Point(428, 157); + this.integerTextBox1.Metrocolor = System.Drawing.Color.FromArgb(((int)(((byte)(209)))), ((int)(((byte)(211)))), ((int)(((byte)(212))))); + this.integerTextBox1.Name = "integerTextBox1"; + this.integerTextBox1.NullString = ""; + this.integerTextBox1.Size = new System.Drawing.Size(141, 20); + this.integerTextBox1.TabIndex = 6; + this.integerTextBox1.Text = "1"; + // + // buttonAdv1 + // + this.buttonAdv1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(22)))), ((int)(((byte)(165)))), ((int)(((byte)(220))))); + this.buttonAdv1.BeforeTouchSize = new System.Drawing.Size(141, 46); + this.buttonAdv1.ForeColor = System.Drawing.Color.White; + this.buttonAdv1.IsBackStageButton = false; + this.buttonAdv1.Location = new System.Drawing.Point(428, 204); + this.buttonAdv1.Name = "buttonAdv1"; + this.buttonAdv1.Size = new System.Drawing.Size(141, 46); + this.buttonAdv1.TabIndex = 7; + this.buttonAdv1.Text = "Click here to see the node corresponding to the ID"; + this.buttonAdv1.Appearance = ButtonAppearance.Metro; + this.buttonAdv1.UseVisualStyle = true; + // + // Form1 + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.BorderColor = System.Drawing.SystemColors.MenuHighlight; + this.BorderThickness = 2; + this.CaptionBarColor = System.Drawing.SystemColors.MenuHighlight; + this.CaptionButtonColor = System.Drawing.Color.White; + this.CaptionForeColor = System.Drawing.Color.White; + this.ClientSize = new System.Drawing.Size(678, 460); + this.Controls.Add(this.buttonAdv1); + this.Controls.Add(this.integerTextBox1); + this.Controls.Add(this.label2); + this.Controls.Add(this.groupBox1); + this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); + this.Name = "Form1"; + this.Text = "TreeViewAdv"; + ((System.ComponentModel.ISupportInitialize)(this.treeViewAdv1)).EndInit(); + this.groupBox1.ResumeLayout(false); + ((System.ComponentModel.ISupportInitialize)(this.integerTextBox1)).EndInit(); + this.ResumeLayout(false); + this.PerformLayout(); + + } + + #endregion + + private Syncfusion.Windows.Forms.Tools.TreeViewAdv treeViewAdv1; + private System.Windows.Forms.GroupBox groupBox1; + private Label label2; + private IntegerTextBox integerTextBox1; + private ButtonAdv buttonAdv1; + } +} \ No newline at end of file diff --git a/TreeViewAdvDemo/C#/Form1.cs b/TreeViewAdvDemo/C#/Form1.cs new file mode 100644 index 0000000..5570e70 --- /dev/null +++ b/TreeViewAdvDemo/C#/Form1.cs @@ -0,0 +1,40 @@ +using Syncfusion.Windows.Forms; +using System; +using System.Windows.Forms; + +namespace TreeViewAdvNodeId +{ + public partial class Form1 : MetroForm + { + #region Constructor + public Form1() + { + InitializeComponent(); + for (int nodeId = 0; nodeId <= 10000; nodeId++) + { + //Custom node for ID propety + CustomTreeNodeAdv customNode = new CustomTreeNodeAdv(); + customNode.ID = nodeId; + customNode.Text = "Node" + nodeId.ToString(); + this.treeViewAdv1.Nodes.Add(customNode); + } + this.buttonAdv1.Click += buttonAdv1_Click; + } + #endregion + + void buttonAdv1_Click(object sender, EventArgs e) + { + //Iterating the nodes in the TreeViewAdv + foreach (CustomTreeNodeAdv item in this.treeViewAdv1.Nodes) + { + //To get the TextBox value + string textvalue = item.ID.ToString(); + if (this.integerTextBox1.Text == textvalue) + { + //Get the node by its ID + MessageBox.Show(item.Text); + } + } + } + } +} \ No newline at end of file diff --git a/TreeViewAdvDemo/C#/Form1.resx b/TreeViewAdvDemo/C#/Form1.resx new file mode 100644 index 0000000..e19ca00 --- /dev/null +++ b/TreeViewAdvDemo/C#/Form1.resx @@ -0,0 +1,145 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + + + AAABAAEAEBAAAAEAIABoBAAAFgAAACgAAAAQAAAAIAAAAAEAIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP// + /wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP// + /wD///8A////AP///wD///8AfUEy/31CM/99QTL/////AH1BMv99QTL/fUEy/////wB9QTL/fUEy/31B + Mv////8A////AP///wD///8A////AH1CM/9+QjP/fUEy/////wB9QTL/fUEy/31BMv////8AfUEy/31C + M/99QTL/////AP///wD///8A////AP///wB9QTL/fUEy/31BMv////8AfUEy/31BMv99QTL/////AH1B + Mv99QTL/fUEy/////wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP// + /wD///8A////AP///wD///8A////AP///wD///8A////AH1BMv99QTL/fUEy/////wB9QTL/fUEy/31B + Mv////8AM5jz/zOY8/8zmPP/////AP///wD///8A////AP///wB9QjP/fkIz/31BMv////8AfUEy/35C + M/99QTL/////ADOY8/8zmPP/M5jz/////wD///8A////AP///wD///8AfUEy/31BMv99QTL/////AH1B + Mv99QTL/fUEy/////wAzmPP/M5jz/zOY8/////8A////AP///wD///8A////AP///wD///8A////AP// + /wD///8A////AP///wD///8AM5jzADOY8wAyl/IA////AP///wD///8A////AP///wB9QTL/fUEy/31B + Mv////8AfUEy/31BMv99QTL/////AP///wD///8AM5jz/////wD///8A////AP///wD///8AfUEy/31B + Mv99QTL/////AH1BMv99QTL/fUEy/////wD///8AM5jz/zOY8/8zmPP/////AP///wD///8A////AH1C + M/99QTL/fUEy/////wB9QTL/fkIz/31BMv////8AM5jz/zOY8/8zmPP/M5jz/zOY8/////8A////AP// + /wD///8A////AP///wD///8A////AP///wD///8A////AP///wAzmPP/M5jz/zOY8/////8A////AP// + /wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////ADOY8/////8A////AP// + /wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP// + /wD///8A//8AAP//AADERwAAxEcAAMRHAAD//wAAxEcAAMRHAADERwAA//8AAMR3AADEYwAAxEEAAP/j + AAD/9wAA//8AAA== + + + \ No newline at end of file diff --git a/TreeViewAdvDemo/C#/Program.cs b/TreeViewAdvDemo/C#/Program.cs new file mode 100644 index 0000000..5f1075c --- /dev/null +++ b/TreeViewAdvDemo/C#/Program.cs @@ -0,0 +1,22 @@ +using System; +using System.Windows.Forms; + +namespace TreeViewAdvNodeId +{ + internal sealed class Program + { + /// + /// The main entry point for the application. + /// + private Program() + { + } + [STAThread] + public static void Main() + { + Application.EnableVisualStyles(); + Application.SetCompatibleTextRenderingDefault(false); + Application.Run(new Form1()); + } + } +} \ No newline at end of file diff --git a/TreeViewAdvDemo/C#/TreeViewAdvNodeId.csproj b/TreeViewAdvDemo/C#/TreeViewAdvNodeId.csproj new file mode 100644 index 0000000..23bcc18 --- /dev/null +++ b/TreeViewAdvDemo/C#/TreeViewAdvNodeId.csproj @@ -0,0 +1,95 @@ + + + + + Debug + AnyCPU + {CCB17670-434C-4F1A-A99D-CF3F300607D8} + WinExe + TreeViewAdvNodeId + TreeViewAdvNodeId + v4.8 + On + Binary + Off + On + On + Binary + Off + On + On + Binary + Off + On + 512 + + + + AnyCPU + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + false + + + AnyCPU + pdbonly + true + bin\Release\ + TRACE + prompt + false + + + + + True + + + + + + + + + + + + + + + + + + + + + + + + + Form + + + Form1.cs + + + + Form1.cs + + + + + + + + \ No newline at end of file diff --git a/TreeViewAdvDemo/C#/TreeViewAdvNodeId.sln b/TreeViewAdvDemo/C#/TreeViewAdvNodeId.sln new file mode 100644 index 0000000..c2d9de7 --- /dev/null +++ b/TreeViewAdvDemo/C#/TreeViewAdvNodeId.sln @@ -0,0 +1,25 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.5.33424.131 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TreeViewAdvNodeId", "TreeViewAdvNodeId.csproj", "{CCB17670-434C-4F1A-A99D-CF3F300607D8}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {CCB17670-434C-4F1A-A99D-CF3F300607D8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {CCB17670-434C-4F1A-A99D-CF3F300607D8}.Debug|Any CPU.Build.0 = Debug|Any CPU + {CCB17670-434C-4F1A-A99D-CF3F300607D8}.Release|Any CPU.ActiveCfg = Release|Any CPU + {CCB17670-434C-4F1A-A99D-CF3F300607D8}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {DDD1AF52-FADC-4DE2-92E6-552C578D33A3} + EndGlobalSection +EndGlobal diff --git a/TreeViewAdvDemo/C#/app.config b/TreeViewAdvDemo/C#/app.config new file mode 100644 index 0000000..c420fe9 --- /dev/null +++ b/TreeViewAdvDemo/C#/app.config @@ -0,0 +1,6 @@ + + + + + + diff --git a/TreeViewAdvDemo/VB/CustomTreeNodeAdv.vb b/TreeViewAdvDemo/VB/CustomTreeNodeAdv.vb new file mode 100644 index 0000000..6300277 --- /dev/null +++ b/TreeViewAdvDemo/VB/CustomTreeNodeAdv.vb @@ -0,0 +1,24 @@ +Imports Syncfusion.Windows.Forms.Tools + +Namespace TreeViewAdvNodeId + 'Creating custom class + Public Class CustomTreeNodeAdv + Inherits TreeNodeAdv + Public Sub New() + 'do something + End Sub + + Private m_NodeId As Integer + ''' + ''' Gets/Sets the Id in TreeNodeAdv + ''' + Public Property ID() As Integer + Get + Return m_NodeId + End Get + Set(ByVal value As Integer) + m_NodeId = value + End Set + End Property + End Class +End Namespace \ No newline at end of file diff --git a/TreeViewAdvDemo/VB/Form1.Designer.vb b/TreeViewAdvDemo/VB/Form1.Designer.vb new file mode 100644 index 0000000..6475aaa --- /dev/null +++ b/TreeViewAdvDemo/VB/Form1.Designer.vb @@ -0,0 +1,158 @@ +Imports Microsoft.VisualBasic +Imports Syncfusion.Windows.Forms.Tools +Imports Syncfusion.Windows.Forms +Imports System.Windows.Forms +Namespace TreeViewAdvNodeId + Partial Public Class Form1 + ''' + ''' Required designer variable. + ''' + Private components As System.ComponentModel.IContainer = Nothing + + ''' + ''' Clean up any resources being used. + ''' + ''' true if managed resources should be disposed; otherwise, false. + Protected Overrides Sub Dispose(ByVal disposing As Boolean) + If disposing AndAlso (components IsNot Nothing) Then + components.Dispose() + End If + MyBase.Dispose(disposing) + End Sub + +#Region "Windows Form Designer generated code" + + ''' + ''' Required method for Designer support - do not modify + ''' the contents of this method with the code editor. + ''' + Private Sub InitializeComponent() + Me.components = New System.ComponentModel.Container() + Dim resources As New System.ComponentModel.ComponentResourceManager(GetType(Form1)) + Me.treeViewAdv1 = New Syncfusion.Windows.Forms.Tools.TreeViewAdv() + Me.groupBox1 = New System.Windows.Forms.GroupBox() + Me.label2 = New System.Windows.Forms.Label() + Me.integerTextBox1 = New Syncfusion.Windows.Forms.Tools.IntegerTextBox() + Me.buttonAdv1 = New Syncfusion.Windows.Forms.ButtonAdv() + CType(Me.treeViewAdv1, System.ComponentModel.ISupportInitialize).BeginInit() + Me.groupBox1.SuspendLayout() + CType(Me.integerTextBox1, System.ComponentModel.ISupportInitialize).BeginInit() + Me.SuspendLayout() + ' + ' treeViewAdv1 + ' + Me.treeViewAdv1.BackColor = System.Drawing.Color.White + Me.treeViewAdv1.BeforeTouchSize = New System.Drawing.Size(250, 274) + Me.treeViewAdv1.Border3DStyle = System.Windows.Forms.Border3DStyle.Flat + Me.treeViewAdv1.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle + Me.treeViewAdv1.CanSelectDisabledNode = False + ' + ' + ' + Me.treeViewAdv1.HelpTextControl.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle + Me.treeViewAdv1.HelpTextControl.Location = New System.Drawing.Point(0, 0) + Me.treeViewAdv1.HelpTextControl.Name = "helpText" + Me.treeViewAdv1.HelpTextControl.Size = New System.Drawing.Size(49, 15) + Me.treeViewAdv1.HelpTextControl.TabIndex = 0 + Me.treeViewAdv1.HelpTextControl.Text = "help text" + Me.treeViewAdv1.Location = New System.Drawing.Point(25, 39) + Me.treeViewAdv1.MetroColor = System.Drawing.Color.FromArgb((CInt(Fix((CByte(22))))), (CInt(Fix((CByte(165))))), (CInt(Fix((CByte(220)))))) + Me.treeViewAdv1.Name = "treeViewAdv1" + Me.treeViewAdv1.SelectedNodeBackground = New Syncfusion.Drawing.BrushInfo(System.Drawing.Color.FromArgb((CInt(Fix((CByte(22))))), (CInt(Fix((CByte(165))))), (CInt(Fix((CByte(220))))))) + Me.treeViewAdv1.ShowFocusRect = False + Me.treeViewAdv1.Size = New System.Drawing.Size(250, 274) + Me.treeViewAdv1.Style = Syncfusion.Windows.Forms.Tools.TreeStyle.Metro + Me.treeViewAdv1.TabIndex = 0 + Me.treeViewAdv1.Text = "treeViewAdv1" + ' + ' + ' + Me.treeViewAdv1.ToolTipControl.BackColor = System.Drawing.SystemColors.Info + Me.treeViewAdv1.ToolTipControl.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle + Me.treeViewAdv1.ToolTipControl.Location = New System.Drawing.Point(0, 0) + Me.treeViewAdv1.ToolTipControl.Name = "toolTip" + Me.treeViewAdv1.ToolTipControl.Size = New System.Drawing.Size(41, 15) + Me.treeViewAdv1.ToolTipControl.TabIndex = 1 + Me.treeViewAdv1.ToolTipControl.Text = "toolTip" + ' + ' groupBox1 + ' + Me.groupBox1.Controls.Add(Me.treeViewAdv1) + Me.groupBox1.Location = New System.Drawing.Point(34, 40) + Me.groupBox1.Name = "groupBox1" + Me.groupBox1.Size = New System.Drawing.Size(311, 349) + Me.groupBox1.TabIndex = 1 + Me.groupBox1.TabStop = False + Me.groupBox1.Text = "TreeViewAdv" + ' + ' label2 + ' + Me.label2.AutoSize = True + Me.label2.Location = New System.Drawing.Point(425, 116) + Me.label2.Name = "label2" + Me.label2.Size = New System.Drawing.Size(98, 13) + Me.label2.TabIndex = 5 + Me.label2.Text = "Type Node ID here" + ' + ' integerTextBox1 + ' + Me.integerTextBox1.BackGroundColor = System.Drawing.SystemColors.Window + Me.integerTextBox1.BeforeTouchSize = New System.Drawing.Size(141, 20) + Me.integerTextBox1.Cursor = System.Windows.Forms.Cursors.IBeam + Me.integerTextBox1.IntegerValue = (CLng(Fix(1))) + Me.integerTextBox1.Location = New System.Drawing.Point(428, 157) + Me.integerTextBox1.Metrocolor = System.Drawing.Color.FromArgb((CInt(Fix((CByte(209))))), (CInt(Fix((CByte(211))))), (CInt(Fix((CByte(212)))))) + Me.integerTextBox1.Name = "integerTextBox1" + Me.integerTextBox1.NullString = "" + Me.integerTextBox1.Size = New System.Drawing.Size(141, 20) + Me.integerTextBox1.TabIndex = 6 + Me.integerTextBox1.Text = "1" + ' + ' buttonAdv1 + ' + Me.buttonAdv1.BackColor = System.Drawing.Color.FromArgb((CInt(Fix((CByte(22))))), (CInt(Fix((CByte(165))))), (CInt(Fix((CByte(220)))))) + Me.buttonAdv1.BeforeTouchSize = New System.Drawing.Size(141, 46) + Me.buttonAdv1.ForeColor = System.Drawing.Color.White + Me.buttonAdv1.IsBackStageButton = False + Me.buttonAdv1.Location = New System.Drawing.Point(428, 204) + Me.buttonAdv1.Name = "buttonAdv1" + Me.buttonAdv1.Size = New System.Drawing.Size(141, 46) + Me.buttonAdv1.TabIndex = 7 + Me.buttonAdv1.Text = "Click here to see the node corresponding to the ID" + Me.buttonAdv1.Appearance = ButtonAppearance.Metro + Me.buttonAdv1.UseVisualStyle = True + ' + ' Form1 + ' + Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0F, 13.0F) + Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font + Me.BorderColor = System.Drawing.SystemColors.MenuHighlight + Me.BorderThickness = 2 + Me.CaptionBarColor = System.Drawing.SystemColors.MenuHighlight + Me.CaptionButtonColor = System.Drawing.Color.White + Me.CaptionForeColor = System.Drawing.Color.White + Me.ClientSize = New System.Drawing.Size(678, 460) + Me.Controls.Add(Me.buttonAdv1) + Me.Controls.Add(Me.integerTextBox1) + Me.Controls.Add(Me.label2) + Me.Controls.Add(Me.groupBox1) + Me.Icon = (CType(resources.GetObject("$this.Icon"), System.Drawing.Icon)) + Me.Name = "Form1" + Me.Text = "TreeViewAdv" + CType(Me.treeViewAdv1, System.ComponentModel.ISupportInitialize).EndInit() + Me.groupBox1.ResumeLayout(False) + CType(Me.integerTextBox1, System.ComponentModel.ISupportInitialize).EndInit() + Me.ResumeLayout(False) + Me.PerformLayout() + + End Sub + +#End Region + + Private treeViewAdv1 As Syncfusion.Windows.Forms.Tools.TreeViewAdv + Private groupBox1 As System.Windows.Forms.GroupBox + Private label2 As Label + Private integerTextBox1 As IntegerTextBox + Private buttonAdv1 As ButtonAdv + End Class +End Namespace \ No newline at end of file diff --git a/TreeViewAdvDemo/VB/Form1.resx b/TreeViewAdvDemo/VB/Form1.resx new file mode 100644 index 0000000..e19ca00 --- /dev/null +++ b/TreeViewAdvDemo/VB/Form1.resx @@ -0,0 +1,145 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + + + AAABAAEAEBAAAAEAIABoBAAAFgAAACgAAAAQAAAAIAAAAAEAIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP// + /wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP// + /wD///8A////AP///wD///8AfUEy/31CM/99QTL/////AH1BMv99QTL/fUEy/////wB9QTL/fUEy/31B + Mv////8A////AP///wD///8A////AH1CM/9+QjP/fUEy/////wB9QTL/fUEy/31BMv////8AfUEy/31C + M/99QTL/////AP///wD///8A////AP///wB9QTL/fUEy/31BMv////8AfUEy/31BMv99QTL/////AH1B + Mv99QTL/fUEy/////wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP// + /wD///8A////AP///wD///8A////AP///wD///8A////AH1BMv99QTL/fUEy/////wB9QTL/fUEy/31B + Mv////8AM5jz/zOY8/8zmPP/////AP///wD///8A////AP///wB9QjP/fkIz/31BMv////8AfUEy/35C + M/99QTL/////ADOY8/8zmPP/M5jz/////wD///8A////AP///wD///8AfUEy/31BMv99QTL/////AH1B + Mv99QTL/fUEy/////wAzmPP/M5jz/zOY8/////8A////AP///wD///8A////AP///wD///8A////AP// + /wD///8A////AP///wD///8AM5jzADOY8wAyl/IA////AP///wD///8A////AP///wB9QTL/fUEy/31B + Mv////8AfUEy/31BMv99QTL/////AP///wD///8AM5jz/////wD///8A////AP///wD///8AfUEy/31B + Mv99QTL/////AH1BMv99QTL/fUEy/////wD///8AM5jz/zOY8/8zmPP/////AP///wD///8A////AH1C + M/99QTL/fUEy/////wB9QTL/fkIz/31BMv////8AM5jz/zOY8/8zmPP/M5jz/zOY8/////8A////AP// + /wD///8A////AP///wD///8A////AP///wD///8A////AP///wAzmPP/M5jz/zOY8/////8A////AP// + /wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////ADOY8/////8A////AP// + /wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP// + /wD///8A//8AAP//AADERwAAxEcAAMRHAAD//wAAxEcAAMRHAADERwAA//8AAMR3AADEYwAAxEEAAP/j + AAD/9wAA//8AAA== + + + \ No newline at end of file diff --git a/TreeViewAdvDemo/VB/Form1.vb b/TreeViewAdvDemo/VB/Form1.vb new file mode 100644 index 0000000..e9d5e86 --- /dev/null +++ b/TreeViewAdvDemo/VB/Form1.vb @@ -0,0 +1,34 @@ +Imports Syncfusion.Windows.Forms +Imports System +Imports System.Windows.Forms + +Namespace TreeViewAdvNodeId + Partial Public Class Form1 + Inherits MetroForm +#Region "Constructor" + Public Sub New() + InitializeComponent() + For nodeId As Integer = 0 To 10000 + 'Custom node for ID propety + Dim customNode As New CustomTreeNodeAdv() + customNode.ID = nodeId + customNode.Text = "Node" & nodeId.ToString() + Me.treeViewAdv1.Nodes.Add(customNode) + Next nodeId + AddHandler Me.buttonAdv1.Click, AddressOf buttonAdv1_Click + End Sub +#End Region + + Private Sub buttonAdv1_Click(ByVal sender As Object, ByVal e As EventArgs) + 'Iterating the nodes in the TreeViewAdv + For Each item As CustomTreeNodeAdv In Me.treeViewAdv1.Nodes + 'To get the TextBox value + Dim textvalue As String = item.ID.ToString() + If Me.integerTextBox1.Text = textvalue Then + 'Get the node by its ID + MessageBox.Show(item.Text) + End If + Next item + End Sub + End Class +End Namespace \ No newline at end of file diff --git a/TreeViewAdvDemo/VB/Program.vb b/TreeViewAdvDemo/VB/Program.vb new file mode 100644 index 0000000..ff4f602 --- /dev/null +++ b/TreeViewAdvDemo/VB/Program.vb @@ -0,0 +1,18 @@ +Imports System +Imports System.Windows.Forms + +Namespace TreeViewAdvNodeId + Friend NotInheritable Class Program + ''' + ''' The main entry point for the application. + ''' + Private Sub New() + End Sub + + Public Shared Sub Main() + Application.EnableVisualStyles() + Application.SetCompatibleTextRenderingDefault(False) + Application.Run(New Form1()) + End Sub + End Class +End Namespace \ No newline at end of file diff --git a/TreeViewAdvDemo/VB/TreeViewAdvNodeId.sln b/TreeViewAdvDemo/VB/TreeViewAdvNodeId.sln new file mode 100644 index 0000000..da6f109 --- /dev/null +++ b/TreeViewAdvDemo/VB/TreeViewAdvNodeId.sln @@ -0,0 +1,25 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.5.33424.131 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "TreeViewAdvNodeId", "TreeViewAdvNodeId.vbproj", "{CCB17670-434C-4F1A-A99D-CF3F300607D8}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {CCB17670-434C-4F1A-A99D-CF3F300607D8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {CCB17670-434C-4F1A-A99D-CF3F300607D8}.Debug|Any CPU.Build.0 = Debug|Any CPU + {CCB17670-434C-4F1A-A99D-CF3F300607D8}.Release|Any CPU.ActiveCfg = Release|Any CPU + {CCB17670-434C-4F1A-A99D-CF3F300607D8}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {0409F643-2481-44F0-86D6-52A9AC2B141F} + EndGlobalSection +EndGlobal diff --git a/TreeViewAdvDemo/VB/TreeViewAdvNodeId.vbproj b/TreeViewAdvDemo/VB/TreeViewAdvNodeId.vbproj new file mode 100644 index 0000000..92a28a0 --- /dev/null +++ b/TreeViewAdvDemo/VB/TreeViewAdvNodeId.vbproj @@ -0,0 +1,104 @@ + + + + + Debug + AnyCPU + {CCB17670-434C-4F1A-A99D-CF3F300607D8} + WinExe + TreeViewAdvNodeId + TreeViewAdvNodeId + v4.8 + On + Binary + Off + On + On + Binary + Off + On + On + Binary + Off + On + On + Binary + Off + On + 512 + + + + AnyCPU + true + full + false + bin\Debug\ + true + true + prompt + false + + + AnyCPU + pdbonly + true + bin\Release\ + false + true + prompt + false + + + + + True + + + + + + + + + + + + + + + + + + + + + + + + + Form + + + Form1.vb + + + + Form1.vb + + + + + + + + + + + \ No newline at end of file diff --git a/TreeViewAdvDemo/VB/app.config b/TreeViewAdvDemo/VB/app.config new file mode 100644 index 0000000..c420fe9 --- /dev/null +++ b/TreeViewAdvDemo/VB/app.config @@ -0,0 +1,6 @@ + + + + + +