Sterile Tree view
-
Why the below code doesn't make any child? What I see on the list is only "Software".
HTREEITEM hTree, hCompany;
hTree = m_cTree.InsertItem("Software", TVI_ROOT);
hCompany = m_cTree.InsertItem("Microsoft", hTree);
m_cTree.InsertItem("Office", hCompany);
m_cTree.InsertItem("Visual Studio", hCompany);
m_cTree.InsertItem("Servers", hCompany);Should I enable any options with the tree?
-
Why the below code doesn't make any child? What I see on the list is only "Software".
HTREEITEM hTree, hCompany;
hTree = m_cTree.InsertItem("Software", TVI_ROOT);
hCompany = m_cTree.InsertItem("Microsoft", hTree);
m_cTree.InsertItem("Office", hCompany);
m_cTree.InsertItem("Visual Studio", hCompany);
m_cTree.InsertItem("Servers", hCompany);Should I enable any options with the tree?
Looks like you have done the right thing. So its probably added but not shown. Try by putting
m_cTree.Expand(TVI_ROOT, TVE_EXPAND)
at the end.«_Superman_» I love work. It gives me something to do between weekends.
-
Looks like you have done the right thing. So its probably added but not shown. Try by putting
m_cTree.Expand(TVI_ROOT, TVE_EXPAND)
at the end.«_Superman_» I love work. It gives me something to do between weekends.
You are right. The code was actually right. But it did not display any "expland-collapse-+" symbol at the corner. When I click on it it's actually expanding. But how do I show that "+" there?
-
You are right. The code was actually right. But it did not display any "expland-collapse-+" symbol at the corner. When I click on it it's actually expanding. But how do I show that "+" there?
The tree control has the
Has Buttons
andHas Lines
properties that you must set to true in the resource editor.«_Superman_» I love work. It gives me something to do between weekends.