It's necessary to insert code to "DrawCell" procedure to judge every second
row and set the color similar as below:

void Transaction_DrawCell( void *tableP, Int16 row, Int16 column,
RectanglePtr bounds)
{
    Char string[DB_PF_STOCKNAME_SIZE];
    UInt16 iTableWidth;
    RectangleType rect;
    UInt16 iLastColWidth;
    TTransactionRecord TransactionRecord;

    //********************************** {
    RGBColorType rgbColor_BkHighlight;
    RGBColorType rgbColor_BkNormal;

    // Red Color
    rgbColor_BkHighlight.r = 255;
    rgbColor_BkHighlight.g = 0;
    rgbColor_BkHighlight.b = 0;

    // White Color
    rgbColor_BkNormal.r = 255;
    rgbColor_BkNormal.g = 255;
    rgbColor_BkNormal.b = 255;
    //********************************** }

    cursorPfHistory = startRow_PfHistory + row;
    Transaction_GetRecord( cursorPfHistory, &TransactionRecord );


    //********************************** {
    // Judge whether it's every second row and set the color
    if(row%2==0)
        WinSetBackColorRGB( &rgbColor_BkHighlight, NULL );
    else
        WinSetBackColorRGB( &rgbColor_BkNormal, NULL );

    //********************************** }

    // Draw cell content
    //    . . . .
    .
    .
    .

Hope it can help.


"Marc" <[EMAIL PROTECTED]> �b�l�� news:[EMAIL PROTECTED] �����g...
> Hi all!
>
> How can I set a color for a table row. I want to set a color every second
> row, so it is better to read.
>
> Thanks.
>
>
>



-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/support/forums/

Reply via email to