怎样判断StringGrid->cells[1][1]是否为空?

favorit 2002-10-23 04:15:22
内容同上!
...全文
134 6 打赏 收藏 转发到动态 举报
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
ghostpro 2003-02-27
  • 打赏
  • 举报
回复

我也觉得favorit(因你飞扬)的方法好
greendesert 2002-10-24
  • 打赏
  • 举报
回复
我觉得favorit(因你飞扬)的方法好些
zbc 2002-10-23
  • 打赏
  • 举报
回复
if (Trim(StringGrid1->Cells[0][0]).Length() == 0)
ShowMessage("单元格为空");

Trim函数是去掉前后的空格,以便有空时,判断错误
yuanque 2002-10-23
  • 打赏
  • 举报
回复
如果是想把空格也当为空的话,先Trim()一下,再做。
Cell[][]是AnsiString类型的
favorit 2002-10-23
  • 打赏
  • 举报
回复
知道了,if(StringGrid->Cells[1][1].IsEmpty())也可以的
wt_sanlian 2002-10-23
  • 打赏
  • 举报
回复
if( StringGrid -> Cells[1][1].Length() == 0)
{
//为空
}

13,873

社区成员

发帖
与我相关
我的任务
社区描述
C++ Builder相关内容讨论区
社区管理员
  • 基础类社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧