i wanted to create a custom treeview so i inherited the treeview class and created 'CustomTreeView' class
there i implemented multiselect concept..
for making the node as selected,
node.BackColor = SystemColors.Highlight;
node.ForeColor = SystemColors.HighlightText;
i used these lines...
but the problem is when i make the control as disabled(ie enabled=false),
the selected node goes invisible..
any other solution to make a node selected??? without this enabled problem?
EDIT: Here is the full function that is called when a node is selected:
private void ToggleNode(TreeNode node, bool bSelectNode)
{
if (bSelectNode)
{
m_SelectedNode = node;
if (!m_SelectedNodes.Contains(node))
m_SelectedNodes.Add(node);
node.BackColor = SystemColors.Highlight;
node.ForeColor = SystemColors.HighlightText;
}
else
{
m_SelectedNodes.Remove(node);
node.BackColor = this.BackColor;
node.ForeColor = this.ForeColor;
}
}
TreeViewcontrol still respects the customBackColorandForeColorproperties set to individual nodes. - Cody GrayBackColorand/orForeColorfor yourTreeView? Those could be similar enough to the highlight colors that it's causing them to look invisible. With a standard whiteBackColorand blackForeColorfor myTreeView, combined with my system's greenHighlightcolor and whiteHighlightTextcolor, I cannot reproduce this behavior. - Cody Gray