Use the InvalidateCell method after setting the object for that cell. Phil. ----- Original Message ----- From: "Kit Jackson" <[EMAIL PROTECTED]> To: "NZ Borland Developers Group - Delphi List" <[EMAIL PROTECTED]> Sent: Wednesday, September 15, 2004 7:13 PM Subject: Re: [DUG] StringGrid
> On Wed, 15 Sep 2004 10:14:44 +1200, Paul McKenzie <[EMAIL PROTECTED]> wrote: > > > I have a StringGrid which I draw an Icon for in column 1 - based on the > > value of data in the Objects property. > > When the value of the Objects Property changes I want the Grid to > > Repaint. > > The problem is that I can't get the Grid to Repaint unless I change the > > value of a String!!! > > I have tried calling various things - Repaint, Invalidate, the > > OnDrawCell, etc. > > Nothing will Repaint unless I change a String value. > > They will repaint if I move off and on the Form - somehow I don't think > > that will be acceptable to the users... > > > > > > Regards > > Paul McKenzie > > SMSS Ltd. > > Wellington > > New Zealand > > > > > There must be something else going on here that you haven't mentioned. I > presume you've got some code such as this in the OnDrawCell event have you > > if (some check on the contents of the object) then > StringGrid1.Canvas.Draw(Rect.Left, Rect.Top, Image1.Picture.Graphic) > > Calling StringGrid1.Repaint in your setter method of the object will > trigger the above code allowing the graphic to be redrawn. Where are you > attempting to force the redraw? I think you might have to show us some > code. > > Kit Jackson > > _______________________________________________ > Delphi mailing list > [EMAIL PROTECTED] > http://ns3.123.co.nz/mailman/listinfo/delphi _______________________________________________ Delphi mailing list [EMAIL PROTECTED] http://ns3.123.co.nz/mailman/listinfo/delphi
