You can add a Shown handler in the Designer and :
private: System::Void Form1_Shown(System::Object^ sender, System::EventArgs^ e)
{
treeView1->SelectedNode = nullptr;
}
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Hi friends, In design mode I put two parent nodes and some child nodes. When I load the program, the first parent node is already selected. I need that when loading, no node is selected. I tried a few times here but it didn't work. I'm studying this control. I tried the following code but it didn't work. I put it in the formload.
for each (TreeNode^ node in treeView1->Nodes)
{
if (node->IsSelected)
treeView1->SelectedNode = nullptr;
}
You can add a Shown handler in the Designer and :
private: System::Void Form1_Shown(System::Object^ sender, System::EventArgs^ e)
{
treeView1->SelectedNode = nullptr;
}