A
Adie
Hi, I can't seem to use the tag property of the treeview without craching
my app. The basic code:
while(SqlProducts.Read())
{
TreeNode childNode = new TreeNode(SqlProducts.GetString(0));
cnode.Tag = "Product Details";
parentNode.Nodes.Add(childNode);
}
private void treeProducts_AfterSelect( object sender,
System.Windows.Forms.TreeViewEventArgs e)
{
text1.text = e.Node.Tag.ToString();
}
There is a QB article which addresses the issue in VB but not C#, anyone
know how to fix it?
Also, why is private void treeProducts_AfterSelect( ... ) called on the
load of the form?
Thanks!
my app. The basic code:
while(SqlProducts.Read())
{
TreeNode childNode = new TreeNode(SqlProducts.GetString(0));
cnode.Tag = "Product Details";
parentNode.Nodes.Add(childNode);
}
private void treeProducts_AfterSelect( object sender,
System.Windows.Forms.TreeViewEventArgs e)
{
text1.text = e.Node.Tag.ToString();
}
There is a QB article which addresses the issue in VB but not C#, anyone
know how to fix it?
Also, why is private void treeProducts_AfterSelect( ... ) called on the
load of the form?
Thanks!