简体   繁体   中英

TStringGrid OnDrawCell Issue

I'm experiencing an issue ussing Drawcell on a TStringGrid with C++ Buidler XE4. In a portion of my C++ code i put some text in cells like in the folowing lines:

StringGrid1->Cells[x][y] = "1.0";

And in the DrawCell Event when i do this :

UnicodeString tmp = StringGrid1->Cells[ACol][ARow];

tmp is "1" (when ACol = x and ARow = y). i am sure that nowhere in my code i replace the "1.0" in "1". So if anybody could explain me what's happen i will be very gracefull.

As i Experiment sometimes it work's and sometimes not (when recompiled).

Are the lower strats of C++Builder (which are delphi ones) sometimes swap (or something like that) the StringGrid behind the TStringGrid?

What you describe cannot be reproduced. The TStringGrid control is know to work well. If you put a string into a cell, that same cell will come back until you modify it.

Most likely there is something else in your program that is modifying this. In order for you to track this down I suggest that you make an SSCCE. Once you do so you'll surely find the reason for your confusion.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM