I'm trying to make sure that I can fire certain events when a node is selected in the TreeView. I run the code and I get an error message that reads NullReferenceException was unhandled: the object reference was not set to the object instance.
Any tips on how to overcome this obstacle?
private void tvNodes_NodeMouseClick(object sender, TreeNodeMouseClickEventArgs e)
{
switch (tvNodes.SelectedNode.Index)
{
case 0:
break;
case 1:
break;
case 2:
break;
}
}
Arnold Frobisher
source
share