Board index » delphi » TStringGrid - Programmed vs. Default cell drawing

TStringGrid - Programmed vs. Default cell drawing

I have a StringGrid in which one column of cells I will write code to draw
a bitmap.

In all of the other columns I simply want to draw the normal text as the
StringGrid would by default.

If I write an OnDrawCell handler in order to draw the bitmaps, am I forced
to draw the text in the other cells, or can I call on the default behavior
for the text drawing.

For example, can I make an "Inherited" call in an OnDrawCell event handler?
 Will it work as I imagine?

I tried to look in Delphi's online help, but the references I found kind of
implied this wouldn't work (mostly by not saying it would).  But perhaps it
will work and just isn't specified explicitly in the online help.

Thanks,
Andy Cook
Omaha, NE
USA

 

Re:TStringGrid - Programmed vs. Default cell drawing


Andy,

for Heavens sake, why didn't you just *try* it? That would have answered your question in less
time than it took you to write and post it! Whatever you do in an OnDrawCell event is on top of
the default drawing, which happens before the handler is called.

Peter Below (TeamB)  100113.1...@compuserve.com)

Quote
In article <01bcba7c$14003440$6ef81fcc@req41493>, Andrew J. Cook wrote:
> From: "Andrew J. Cook" <AJC...@ix.netcom.com>
> Newsgroups: borland.public.delphi.vcl.components.using,comp.lang.pascal.delphi.components.usage
> Subject: TStringGrid - Programmed vs. Default cell drawing
> Date: 6 Sep 1997 04:20:07 GMT

> I have a StringGrid in which one column of cells I will write code to draw
> a bitmap.

> In all of the other columns I simply want to draw the normal text as the
> StringGrid would by default.

> If I write an OnDrawCell handler in order to draw the bitmaps, am I forced
> to draw the text in the other cells, or can I call on the default behavior
> for the text drawing.

> For example, can I make an "Inherited" call in an OnDrawCell event handler?
>  Will it work as I imagine?

> I tried to look in Delphi's online help, but the references I found kind of
> implied this wouldn't work (mostly by not saying it would).  But perhaps it
> will work and just isn't specified explicitly in the online help.

> Thanks,
> Andy Cook
> Omaha, NE
> USA

Other Threads