0
我有一個二維數組,包含一個矩陣的元素當我在VS2010中寫入一個基於對話框的項目時,我想在編輯控件框中顯示矩陣的內容,但我在裏面添加了代碼按鈕控件 如下。VC++中的矩陣格式
void CtestCstrDlg::OnBnClickedButton1()
{
CString strTest(" "), strB,strC;
// TODO: Add your control notification handler code here
for(int i=0;i<4;i++)
{
for(int j=0;j<4;j++)
{
strB.Format(L"%d ", j);
strTest+=strB;
}
strTest+="\n";
}
m_edDisp.SetWindowTextW(strTest);
}
但我發現在運行時,如果我點擊按鈕,它只顯示一行內容。 如何獲得像方形
0 1 2 3
0 1 2 3
0 1 2 3
0 1 2 3
? 請幫我..
非常感謝Adams。它的工作........謝謝.... – user543265 2011-01-20 06:00:04