ListView_SetItemText Probleme



  • problem ist, das ich die erste spalte füllen kann, die zweite aber nicht...

    das hier wäre dann der code wo ich die spalten erzeuge:

    col.mask = LVCF_FMT | LVCF_WIDTH | LVCF_TEXT | LVCF_SUBITEM;
    col.fmt = LVCFMT_LEFT ;
    col.pszText = "Name";
    col.cchTextMax = strlen("Name");
    col.cx = 120;
    col.iSubItem = 0;
    ListView_InsertColumn(listHwnd,1,&col);

    col.mask = LVCF_FMT | LVCF_WIDTH | LVCF_TEXT | LVCF_SUBITEM;
    col.fmt = LVCFMT_LEFT ;
    col.pszText = "Datum";
    col.cchTextMax = strlen("Datum");
    col.cx = 72;
    col.iSubItem = 1;
    ListView_InsertColumn(listHwnd,2,&col);

    so hier dann der code für die erste spalte:

    LVITEM item;
    item.stateMask = 0;
    item.mask = LVIF_TEXT;
    item.cchTextMax = MAX_PATH;
    item.iItem = 1;
    item.iSubItem = 0;
    item.pszText = "asdfasdf";
    ListView_InsertItem(listHwnd, &item);

    das funzt, jetzt wollt ich aber nen subitem füllen:

    ListView_SetItemText(listHwnd,1,1,"asdfasf");

    tut nischt 😕



  • unter diesr Überschrift steht eine lösung
    C/C++ Forum :: WinAPI :: Listbox
    http://www.c-plusplus.net/forum/viewtopic.php?t=43770



  • hab zwar das forum durchforstet, aber hab wohl doch den beitrag übersehen



  • 👍 Kann immer mal passieren, dort gings ja auch ursprünglich um listboxen die dann zu listview mutierten


Anmelden zum Antworten