关于CB中stringGrid控件单元格中显示多行文字的一个问题
我在StingGrid控件的DrawCell事件下调用DrawText函数,代码如下:
DrawText(StringGrid1->Canvas->Handle,
StringGrid1->Cells[ACol][ARow].C_Str(),
StringGrid->Cells[ACol][ARow].Length(),
Rect,
DT_WORDBREAK);
编译时出现错误:E2034 Cannot convert 'TRect' to 'tagRECT'
E2342 Type mismatch in parameter 'lpRect'(wanted 'tagRECT',got 'TRect')
我通过在DrawCell事件下定义RECT *a ;而后通过a->left = Rect.left; a->top = Rect.top; a->right = Rect;right; a->bottom = Rect.bottom;给a复制,在调用
DrawText(StringGrid1->Canvas->Handle,
StringGrid1->Cells[ACol][ARow].C_Str(),
StringGrid->Cells[ACol][ARow].Length(),
a,
DT_WORDBREAK);在运行时出错.
请问如何解决?
如果不行在CB中使用什么表格控件可使单元格中的文本多行显示?