0
我正在研究一个复杂的网格布局,并且UltimateGrid是我的选择。标题中的多行文本
我已经设置了一个多行标题,然后我有在垂直标题加入了一些单元格。
现在,我正在寻找一种方法来设置我已加入的标题单元格中的多行文本。
下面是一个解释性屏幕截图。
我已经通过书面形式尝试:
void MyCug::OnSetup(){
int rows = 5;
int cols = 20;
// setup rows and columns
SetNumberRows(rows);
SetNumberCols(cols);
// create 3 row top heading
SetTH_NumberRows(2);
...
JoinCells (16, -2, 16, -1); // Here I joins - in heading - two cells : row 16, columns -2 and -1
...
// Then I retrieve merged cell
CUGCell m_cell;
GetCell(16, -2, &m_cell);
// I need to show multi-line content in heading cells: I tried to set multi-row property.
int result = m_cell.SetPropertyFlags(m_cell.GetPropertyFlags() | UGCELL_MULTIROWCELL);
if (result == UG_SUCCESS) {
bool ok = true; // all seems to be ok...
}
m_cell.SetText("string\r\nstring\r\nstring"); // Despite my attempt, this will be always show on a single line!
SetCell(16, -3, &m_cell);
...
}
没有成功:单元格文本总是在一行上显示,这正是我不想要什么。
如何获得多行上的单元格文本?
\ N'。连续试一试,看看哪一个适合你 – cha 2013-02-15 00:12:28