Why, is it too much hassle? Try keeping it in a text file in your components 
folder so you can use the modern computer magic of "cut and paste" when you 
need it.

Dave

--- On Sun, 8/16/09, Loay Habash <[email protected]> wrote:

From: Loay Habash <[email protected]>
Subject: [delphi-en] Transerant StringGrid
To: "delphi" <[email protected]>
Date: Sunday, August 16, 2009, 1:33 AM






 




    
                  Hello,

Pls. anybody can help me in creating Transparent String grid, or at least show 
the background image inside the cells.

 

I downloaded some code from the net and it work fine, But I need to make it as 
a component attached with this code, I don't need to rewrite this code each 
time I need to use this option.

 

The code :

 

procedure TForm1.StringGrid1D rawCell(Sender: TObject; ACol, ARow: Integer;

  Rect: TRect; State: TGridDrawState) ;

var

  Text: string;

  Rct: TRect;

begin

  Text := TStringGrid( sender).Cells[ ACol,ARow] ;

  Rct:= Rect;

  BitBlt(TStringGrid( sender).Canvas. handle,

         Rct.left,

         Rct.top,

         Rct.right - Rct.left,

         Rct.bottom - Rct.top,

         Image1.Canvas. Handle,

         Rct.left + TStringGrid( sender).Left ,

         Rct.Top + TStringGrid( sender).Top ,

         SRCCOPY);

  SetBkModE(TStringGr id(sender) .Canvas.Handle, TRANSPARENT) ;

  TStringGrid( sender).Canvas. .Font.Style := [fsBold];

  DrawtextEx(TStringG rid(sender) .Canvas.Handle,

             PChar(Text),

             Length(Text) ,

             Rct,

             DT_WORDBREAK,

             nil);



end;



 

Loay Habash, 

http://groups. yahoo.com/ group/WeLoveYouA ll/ 

http://profiles. yahoo.com/ leohabash 

leohab...@yahoo. com 

Mobile: +966503322315



[Non-text portions of this message have been removed]




 

      

    
    
        
         
        
        








        


        
        


      

[Non-text portions of this message have been removed]

Reply via email to