| View previous topic :: View next topic |
| Author |
Message |
Zyrca
Joined: 19 Apr 2002 Posts: 219 Location: MA
|
Posted: Tue Jun 17, 2003 8:48 am Post subject: c++ (VS 6.0) - Adding Rows to a List Control |
|
|
Syntax:
m_lstList->PutData(col, row, subVal, data);
col = column number
row = row number
subVal = 1 if it's an image from portal.dat, the apps hinstance if it's a custom icon, and 0 otherwise
data = the icon id from the portal.dat, text or value for a check column
Example:
// Create the row that you will be changing
m_lstList->AddRow();
// Set the icon in an icon column
m_lstList->PutData(0,0,1, &_variant_t( 0x06001FF4L ));
// Set the text in a text column
m_lstList->PutData(1,0,0, &_variant_t( "Some Text" ));
// Set the check box in a check column
m_lstList->PutData(2,0,0, &_variant_t( VARIANT_TRUE )); _________________ -Zyrca |
|
| Back to top |
|
 |
paradox Teh Decal L33T!

Joined: 19 Apr 2002 Posts: 333
|
Posted: Tue Sep 30, 2003 1:39 pm Post subject: err |
|
|
the above post is in error reguarding subval
subval may only ever be 0 or 1 currently.
for icon columns that use icons from the portal.dat
m_lstList->PutData(0,0,1, &_variant_t( 0x06001FF4L ));
is correct.
if you want to use custom resouces do the following
m_lstList->PutData(0,0,0, &_variant_t( hInst ));
m_lstList->PutData(0,0,1, &_variant_t( RES_ID )); |
|
| Back to top |
|
 |
deadeye-we

Joined: 10 Nov 2002 Posts: 69
|
Posted: Fri Oct 03, 2003 11:01 am Post subject: |
|
|
The above example by Zyrca should be:
| Code: | long nRow;
// Create the row that you will be changing
nRow = m_lstList->AddRow();
// Set the icon in an icon column
m_lstList->PutData(0,nRow,1, &_variant_t( 0x06001FF4L ));
// Set the text in a text column
m_lstList->PutData(1,nRow,0, &_variant_t( "Some Text" ));
// Set the check box in a check column
m_lstList->PutData(2,nRow,0, &_variant_t( VARIANT_TRUE ));
|
othwise the first row would be overlaid each time since rows are added to the end. |
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|