/// <summary> /// Añade un nodo a un treeView /// </summary> public TreeNode AddNode(TreeNode trnParent, TreeNodeKey objNodeKey, string strText, bool blnWithChilds, int intImageIndex, Color clrNode, bool blnBold) { TreeNode trnNode; // Añade el nodo al árbol if (trnParent == null) { trnNode = Nodes.Add(objNodeKey.ID.ToString(), strText, intImageIndex, intImageIndex); } else { trnNode = trnParent.Nodes.Add(objNodeKey.ID.ToString(), strText, intImageIndex, intImageIndex); } // Asigna las claves trnNode.Tag = objNodeKey; // Cambia la fuente del nodo if (blnBold) { trnNode.NodeFont = new Font(this.Font, FontStyle.Bold); } // Cambia el color del nodo if (clrNode != Color.Transparent) { trnNode.ForeColor = clrNode; } // Si puede tener hijos le añade un nodo vacío if (blnWithChilds) { trnNode.Nodes.Add(cnstStrTextEmptyChild); } // Devuelve el nodo return(trnNode); }
/// <summary> /// Añade un nodo a un treeView /// </summary> public TreeNode AddNode(TreeNode trnParent, TreeNodeKey objNodeKey, string strText, bool blnWithChilds, int intImageIndex, Color clrNode) { return AddNode(trnParent, objNodeKey, strText, blnWithChilds, intImageIndex, clrNode, false); }
/// <summary> /// Añade un nodo a un treeView /// </summary> public TreeNode AddNode(TreeNode trnParent, TreeNodeKey objNodeKey, string strText, bool blnWithChilds) { return AddNode(trnParent, objNodeKey, strText, blnWithChilds, -1, Color.Transparent, false); }
/// <summary> /// Añade un nodo a un treeView /// </summary> public TreeNode AddNode(TreeNode trnParent, TreeNodeKey objNodeKey, string strText, bool blnWithChilds, int intImageIndex, Color clrNode, bool blnBold) { TreeNode trnNode; // Añade el nodo al árbol if (trnParent == null) trnNode = Nodes.Add(objNodeKey.ID.ToString(), strText, intImageIndex, intImageIndex); else trnNode = trnParent.Nodes.Add(objNodeKey.ID.ToString(), strText, intImageIndex, intImageIndex); // Asigna las claves trnNode.Tag = objNodeKey; // Cambia la fuente del nodo if (blnBold) trnNode.NodeFont = new Font(this.Font, FontStyle.Bold); // Cambia el color del nodo if (clrNode != Color.Transparent) trnNode.ForeColor = clrNode; // Si puede tener hijos le añade un nodo vacío if (blnWithChilds) trnNode.Nodes.Add(cnstStrTextEmptyChild); // Devuelve el nodo return trnNode; }
public TreeViewExtendedEventArgs(System.Windows.Forms.TreeNode trnNode, TreeNodeKey objTreeNodeKey) { Node = trnNode; Keys = objTreeNodeKey; }
/// <summary> /// Añade un nodo a un treeView /// </summary> public TreeNode AddNode(TreeNode trnParent, TreeNodeKey objNodeKey, string strText, bool blnWithChilds, int intImageIndex) { return(AddNode(trnParent, objNodeKey, strText, blnWithChilds, intImageIndex, Color.Transparent, false)); }