Hello,
Thank you for at least repling my Email, am not sure that I can build my own 
componnents, thats why I need this code which will make the StringGrid 
Transparent. to be as a new component at the OnGridCell event.
 
Thank you,
Loay Habash, 


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


From: David Smith <[email protected]>
Subject: Re: [delphi-en] Transerant StringGrid
To: [email protected]
Date: Sunday, August 16, 2009, 7:46 PM


  



   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 <leohab...@yahoo. com> wrote:

From: Loay Habash <leohab...@yahoo. com>
Subject: [delphi-en] Transerant StringGrid
To: "delphi" <delphi...@yahoogrou ps.com>
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]

















      

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

Reply via email to