Real Software Forums
http://forums.realsoftware.com/

Problem with CellTextPaint Event. Not painting correctly
http://forums.realsoftware.com/viewtopic.php?f=1&t=47989
Page 1 of 1

Author:  HMARROQUINC [ Mon May 27, 2013 1:52 pm ]
Post subject:  Problem with CellTextPaint Event. Not painting correctly

Hi,

Another of those moments... I'm using the following code in a Listbox CellTextPaint

If Me.Selected(row) = True Then
g.ForeColor = RGB(0,0,0)
End If

If row = 0 Then
g.DrawString Me.Cell(row, column), x, 15, g.width - (x + 3) , False
else
Return False
End If


The selected color works perfectly, however I´m trying to get the text into two lines in column one, the code I have above works perfectly but only for the first Row, the following rows are not being drawn properly, plus the column in the thrid row is being split into two lines. Am I missing something?

Author:  classone [ Mon May 27, 2013 2:00 pm ]
Post subject:  Re: Problem with CellTextPaint Event. Not painting correctly

Quote:
works perfectly but only for the first Row

You're only drawing it in the first row...
Quote:
If row = 0 Then

The other rows you are returning false so RB handles the drawing in the standard way.

Author:  HMARROQUINC [ Mon May 27, 2013 3:36 pm ]
Post subject:  Re: Problem with CellTextPaint Event. Not painting correctly

Oh (insert your favorite Deity here) !!!

Thanks for pointing that out. I´ll go to my room and write "Column" 10,000 times.

Thanks!

Page 1 of 1 All times are UTC - 5 hours
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/