Necesito un ejemplo de un CtreeCtrl simple por ejemplo
- PADRE
- HIJO
+OTRO PADRE
Etc... muchisimas gracias
![]() |
![]() |
|
Moderador: latindeveloper

TVINSERTSTRUCT tvInsert;
tvInsert.hParent = NULL;
tvInsert.hInsertAfter = NULL;
tvInsert.item.mask = TVIF_TEXT;
tvInsert.item.pszText = _T("United States");
HTREEITEM hCountry = m_TreeCtrl.InsertItem(&tvInsert);
HTREEITEM hPA = m_TreeCtrl.InsertItem(TVIF_TEXT,_T("Pennsylvania"), 0, 0, 0, 0, 0, hCountry, NULL);
HTREEITEM hWA = m_TreeCtrl.InsertItem(_T("Washington"),0, 0, hCountry, hPA);
// We'll add some cities under each of the states.
// The override used here is most appropriate
// for inserting text-only items.
m_TreeCtrl.InsertItem(_T("Pittsburgh"), hPA, TVI_SORT);
m_TreeCtrl.InsertItem(_T("Harrisburg"), hPA, TVI_SORT);
m_TreeCtrl.InsertItem(_T("Altoona"), hPA, TVI_SORT);
m_TreeCtrl.InsertItem(_T("Seattle"), hWA, TVI_SORT);
m_TreeCtrl.InsertItem(_T("Kalaloch"), hWA, TVI_SORT);
m_TreeCtrl.InsertItem(_T("Yakima"), hWA, TVI_SORT);
Usuarios navegando por este Foro: No hay usuarios registrados visitando el Foro y 0 invitados