Listbox CellTag LowerCas Uppercase

I’m trying to draw a picture in a listbox cell depending on whether the character in the celltag is lowercase or uppercase but it looks like RB automatically takes lowercase. I proceed as follows:

if me.CellTag(Row, Column) = Chr(65) Then g.DrawPicture Pic(90), 0, 0 if me.CellTag(Row, Column) = Chr(97) Then g.DrawPicture Pic(97), 0, 0

Thank you for your help.

You should use a compare case sensitive or the ASC value of the cell and CellTagString

Standard string comparing in Xojo is no case sensitive so “a”=“A” returns true

Thank you Antonio.
I used to employ strings for celltags but it seemed strange to me that by using Chr there was no distinction.

Chr() returns a string, so you’re comparing 2 strings. String comparison is case insensitive. You could either compare Asc() values

if Asc(me.CellTag(Row, Column)) = 65

Or use the string compare function.

Thanks also Tim,
That’s what I finally did. It comes from old habits with previous software :slight_smile: