[求助]如何利用StringGrid控件安排考场座位表
<P>我在实现安排考场座位表,是想在C++Builder中把一张Form窗体看成教室,然后利用StringGrid的格式,,安排出考生的考试座位表,,,,请教各位高手,,,,,能否帮个忙实现下,谢谢[em01]</P><P> m_InvInfoStringGrid->CleanupInstance();<BR> m_InvInfoStringGrid->RowCount = FillMain->SaleBillCount+1;<BR> m_InvInfoStringGrid->ColCount = 6;<BR> m_InvInfoStringGrid->ColWidths[0] = 35;<BR> m_InvInfoStringGrid->ColWidths[1] = 120;<BR> m_InvInfoStringGrid->ColWidths[2] = 200;<BR> m_InvInfoStringGrid->ColWidths[3] = 100;<BR> m_InvInfoStringGrid->ColWidths[4] = 100;<BR> m_InvInfoStringGrid->ColWidths[5] = 100;<BR> m_InvInfoStringGrid->Cells[0][0] = "序号";<BR> m_InvInfoStringGrid->Cells[1][0] = "编号";<BR> m_InvInfoStringGrid->Cells[2][0] = "客户名称";<BR> m_InvInfoStringGrid->Cells[3][0] = "不含税金额";<BR> m_InvInfoStringGrid->Cells[4][0] = "税额";<BR> m_InvInfoStringGrid->Cells[5][0] = "含税金额";</P>
<P> std::vector<std::pair< AnsiString, INVOICELISTINFO* > >::iterator it;<BR> int nIndex = 1;<BR> for( it = m_vecInvInfo.begin(); it != m_vecInvInfo.end(); ++it,nIndex++)<BR> {<BR> m_InvInfoStringGrid->Cells[0][nIndex] = nIndex;<BR> m_InvInfoStringGrid->Cells[1][nIndex] = it->first;<BR> m_InvInfoStringGrid->Cells[2][nIndex] = it->second->strMerName;<BR> m_InvInfoStringGrid->Cells[3][nIndex] = FormatFloat("###,###,###,##0.00",it->second->fTotalPriceWithoutfCess); <BR> m_InvInfoStringGrid->Cells[4][nIndex] = FormatFloat("###,###,###,##0.00",it->second->fTax);<BR> m_InvInfoStringGrid->Cells[5][nIndex] = FormatFloat("###,###,###,##0.00",it->second->fTotalPrice);<BR> }</P> [em06]我比较笨..还是没能把你的例子和我的问题结合起来,只是看的懂要用二维数组,能否给个详细的解释呢? <P>我那个例子是说明怎么用那个stringgrid,你可以根据我给的例子自己想算法</P>
页:
[1]
