W
weird0
Here is the code that i have been using to add nodes dynamically, but
I cant see any child nodes being displayed on the treeView... all i
can see the root node "Network". I have been trying to develop a
modelling soft. as an educational project.
// event fires when shape is added to visio control
if (vsoMaster.Name == "Ellipse")
{
addedShape.Name=(string)"Node" +
NodeCount.ToString(); // Ellipse01
addedShape.Text = (string)"Node" +
NodeCount.ToString();
MessageBox.Show(addedShape.Name.ToString()); //
does how here
nodeArray = new Node[NodeCount];
nodeArray[NodeCount].Name="Node" +
NodeCount.ToString() ;
nodeArray[NodeCount].Id = NodeCount.ToString();
treeViewForm.NodeAdd(nodeArray[NodeCount].Name.ToString()); // add
node to trieview
MessageBox.Show(nodeArray[NodeCount].Name.ToString()); // does not
show a messagebox here why????
NodeCount++;
}
here is the treeView form :
public partial class TreeViewForm : Form
{
TreeNode ParentNode;
public TreeViewForm()
{
InitializeComponent();
}
private void TreeViewForm_Load(object sender, EventArgs e)
{
ParentNode = treeView1.Nodes.Add("Network");
ParentNode.Expand();
}
public void NodeAdd( string nodeName)
{
ParentNode.Nodes.Add(nodeName);
ParentNode.Expand();
}
private void treeView1_NodeMouseDoubleClick(object sender,
TreeNodeMouseClickEventArgs e)
{
string NodeId=treeView1.SelectedNode.Text;
}
}
Need help
Regards
I cant see any child nodes being displayed on the treeView... all i
can see the root node "Network". I have been trying to develop a
modelling soft. as an educational project.
// event fires when shape is added to visio control
if (vsoMaster.Name == "Ellipse")
{
addedShape.Name=(string)"Node" +
NodeCount.ToString(); // Ellipse01
addedShape.Text = (string)"Node" +
NodeCount.ToString();
MessageBox.Show(addedShape.Name.ToString()); //
does how here
nodeArray = new Node[NodeCount];
nodeArray[NodeCount].Name="Node" +
NodeCount.ToString() ;
nodeArray[NodeCount].Id = NodeCount.ToString();
treeViewForm.NodeAdd(nodeArray[NodeCount].Name.ToString()); // add
node to trieview
MessageBox.Show(nodeArray[NodeCount].Name.ToString()); // does not
show a messagebox here why????
NodeCount++;
}
here is the treeView form :
public partial class TreeViewForm : Form
{
TreeNode ParentNode;
public TreeViewForm()
{
InitializeComponent();
}
private void TreeViewForm_Load(object sender, EventArgs e)
{
ParentNode = treeView1.Nodes.Add("Network");
ParentNode.Expand();
}
public void NodeAdd( string nodeName)
{
ParentNode.Nodes.Add(nodeName);
ParentNode.Expand();
}
private void treeView1_NodeMouseDoubleClick(object sender,
TreeNodeMouseClickEventArgs e)
{
string NodeId=treeView1.SelectedNode.Text;
}
}
Need help
Regards