Recent

Author Topic: TStringgrid not always drawing images in OnDrawCell  (Read 2338 times)

Fantablup

  • Full Member
  • ***
  • Posts: 170
TStringgrid not always drawing images in OnDrawCell
« on: July 30, 2021, 05:27:30 pm »
I just saw this.
Using Canvas.Draw().

When adding 60 images or more, and scrolling up and down, it is not always drawing the images in the cells i have in an array. Only text is drawed if it should also have text.

I had to add procedure WMHScroll and procedure WMVScroll to the grid.
And when it detect the scroll, i set it to repaint the grid.

Then it is all working.


Just wanted to tell, in case of other have the same issue.
« Last Edit: July 30, 2021, 05:38:09 pm by Fantablup »

winni

  • Hero Member
  • *****
  • Posts: 3197
Re: TStringgrid not always drawing images in OnDrawCell
« Reply #1 on: July 30, 2021, 07:19:46 pm »
Hi!

A StringGrid is for strings.

When you want to draw 60 images and more the use the DrawGrid.

Winni

Fantablup

  • Full Member
  • ***
  • Posts: 170
Re: TStringgrid not always drawing images in OnDrawCell
« Reply #2 on: July 30, 2021, 07:39:19 pm »
Thanks Winni!

Just wanted to let others to know.

I thought the canvas has nothing to do with the rest. It is just drawing on the canvas.

I never used the drawgrid. Have to look at it. But need it to be editable, like editing text.
« Last Edit: July 30, 2021, 07:47:33 pm by Fantablup »

Fantablup

  • Full Member
  • ***
  • Posts: 170
Re: TStringgrid not always drawing images in OnDrawCell
« Reply #3 on: July 30, 2021, 09:13:00 pm »
Seems like i have to use tstringgrid for now.
Tdrawgrid has no editor in it.

But it works really good now with tstringgrid after adding the two procedures. So, No need to use something else i guess.

 

TinyPortal © 2005-2018