T
Tony
I'm trying to set a treeview node font style to Bold:
TreeNode newNode = new TreeNode("Nodename");
Font oldFont = TreeView.Nodes[0].NodeFont; // <---Error occurs here
newNode.NodeFont = new Font(oldFont, System.Drawing.FontStyle.Bold);
oldFont.Dispose();
But it doesn't work because TreeView.Nodes[0].NodeFont always throws an
"Object reference not set to an instance of an object." error. In
QuickWatch the NodeFont shows an <undefined error>.
What's the secret handshake to get this to work?
TreeNode newNode = new TreeNode("Nodename");
Font oldFont = TreeView.Nodes[0].NodeFont; // <---Error occurs here
newNode.NodeFont = new Font(oldFont, System.Drawing.FontStyle.Bold);
oldFont.Dispose();
But it doesn't work because TreeView.Nodes[0].NodeFont always throws an
"Object reference not set to an instance of an object." error. In
QuickWatch the NodeFont shows an <undefined error>.
What's the secret handshake to get this to work?