1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
  2. Donation with Paypal!!!

    Go to your paypal account and send directly donation to [email protected]

    1 month - 10 $ - Standart VIP

    6 months - 20 $- Standart VIP

    1 year - 30 $- Standart VIP

    2 years - 50 $- Standart VIP

    Gold member for life - 150 $- Standart VIP

    High Vip (Standart VIP include) group please send PM or email to [email protected] for info

    After Donation please send email to [email protected]

  3. Donation Ways 2020


    Paysend
  4. Telegram
Dismiss Notice

Donation with Paypal!!!

Go to your paypal account and send directly donation to [email protected]

1 month - 10 $ - Standart VIP

6 months - 20 $- Standart VIP

1 year - 30 $- Standart VIP

2 years - 50 $- Standart VIP

Gold member for life - 150 $- Standart VIP

High Vip (Standart VIP include) group please send PM or email to [email protected] for info

After Donation please send email to [email protected]

Dismiss Notice
For open hidden message no need write thanks, thank etc. Enough is click to like button on right side of thread.

Delphi - DBGrid Color Item

Discussion in 'Delphi Programming' started by AdminDF, Feb 14, 2014.

  1. AdminDF
    Online

    AdminDFAdminDF is a Verified Member Delphifan Staff Member DF Staff

    Code:
    { Define custom colors }
    const
    clPaleGreen = TColor($CCFFCC); 
    clPaleRed = TColor($CCCCFF); 
    begin 
    { Set default font color } 
    DBGrid1.Canvas.Font.Color := clBlack; 
    { Is current cell the focused cell? } 
    if (gdFocused in State) then begin 
    if (IBCQuery1.RecNo mod 2)=0 then 
    begin 
    DBGrid1.Canvas.Brush.Color := clBlue; 
    DBGrid1.Canvas.Font.Color := clWhite; 
    end; 
    end 
    { Not focused, is it the target field Terms? } 
    else if (IBCQuery1.RecNo mod 2)=0 then 
    { Check field content for one of two possible values } 
    DBGrid1.Canvas.Brush.Color := $00F2F5F7
    else 
    { Paint non-focused and non-target cells white } 
    DBGrid1.Canvas.Brush.Color := clWhite; 
    { Draw the cell! } 
    DBGrid1.DefaultDrawDataCell(Rect, Field, State);
     

Share This Page