|
-
Jul 9th, 2002, 05:33 PM
#1
Thread Starter
Frenzied Member
cannot add items to second column in ListView
My List View is set to Report style.
I can add data to the first column fine, but when I try to use the iSubItem flag, the string is not added to the second column.
Code:
lvColumn.mask = LVCF_TEXT | LVCF_WIDTH;
lvColumn.cx = 100;
lvColumn.pszText = "Column 1";
ListView_InsertColumn(hWndListView, 0, &lvColumn);
lvColumn.pszText = "Column 2";
ListView_InsertColumn(hWndListView, 1, &lvColumn);
lvItem.mask = LVIF_TEXT;
lvItem.pszText = "row 1, col 1";
ListView_InsertItem(hWndListView, &lvItem);
lvItem.pszText = "row 2, col 1";
ListView_InsertItem(hWndListView, &lvItem);
lvItem.iSubItem = 1;
lvItem.pszText = "row 1, col 2";
ListView_InsertItem(hWndListView, &lvItem);
-
Jul 9th, 2002, 06:14 PM
#2
Frenzied Member
Col header or data?
For Data you use:
ListView_SetItemText(g_hWnd_ListView, iCol, iSubItes, LPSTR_String)
MSVS 6, .NET & .NET 2003 Pro
I HATE MSDN with .NET & .NET 2003!!!
Check out my sites:
http://www.filthyhands.com
http://www.techno-coding.com

-
Jul 9th, 2002, 06:18 PM
#3
Frenzied Member
So for:
lvItem.pszText = "row 2, col 1";
ListView_InsertItem(hWndListView, &lvItem);
ListView_SetItemText(g_hWnd_ListView, 1, 1 /*Remember starts with 0*/,"row 2, col 1")
If you need any more help get my Demo of the progressbar in a listview
http://www.vbforums.com/showthread.p...hreadid=185111
MSVS 6, .NET & .NET 2003 Pro
I HATE MSDN with .NET & .NET 2003!!!
Check out my sites:
http://www.filthyhands.com
http://www.techno-coding.com

-
Jul 9th, 2002, 10:17 PM
#4
Thread Starter
Frenzied Member
-
Jul 9th, 2002, 10:20 PM
#5
Thread Starter
Frenzied Member
Can you autosize the column widths or do you have to set them manually?
And can you disable the manual mouse resizing of the columns?
-
Jul 10th, 2002, 12:52 AM
#6
Frenzied Member
Can you autosize the column widths or do you have to set them manually?
I dont know the answer, but I will look it up. I think you have to do it manually.
And can you disable the manual mouse resizing of the columns?
Look at my demo, under WM_NOTIFY, you will see there how I keep the size from going below 80. Just take out the 80 part and have it return TRUE;
Sorry I dont have to program infront of me, I am at home, or I would just give you the code.
MSVS 6, .NET & .NET 2003 Pro
I HATE MSDN with .NET & .NET 2003!!!
Check out my sites:
http://www.filthyhands.com
http://www.techno-coding.com

Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|