Help MS FlexGrid SetColWidth problem! [modified]
-
In a dialog based program, I insert a MS FlexGrid control, and I stretch the grid to fill the rect as I want. But use SetColWidth not set the column as wide as I want. my code below:
m_grid.SetRows(3);
m_grid.SetCols(2);
m_grid.SetRow(0);
m_grid.SetCol(0);
m_grid.SetText(_T("name"));m_grid.SetRow(0);
m_grid.SetCol(1);
m_grid.SetText(_T("age"));
CRect rcGrid;
m_grid.GetClientRect(&rcGrid);
int iColWidth = 0;
iColWidth = rcGrid.Width()/2;
m_grid.SetColWidth(0, iColWidth); //not half width of the rect!
m_grid.SetColWidth(1, iColWidth); //not half width of the rect!BTW, is there any links I can get help of MS FlexGrid or code samples? So I don't have to ask every functions here!
modified on Monday, August 25, 2008 4:21 AM
-
In a dialog based program, I insert a MS FlexGrid control, and I stretch the grid to fill the rect as I want. But use SetColWidth not set the column as wide as I want. my code below:
m_grid.SetRows(3);
m_grid.SetCols(2);
m_grid.SetRow(0);
m_grid.SetCol(0);
m_grid.SetText(_T("name"));m_grid.SetRow(0);
m_grid.SetCol(1);
m_grid.SetText(_T("age"));
CRect rcGrid;
m_grid.GetClientRect(&rcGrid);
int iColWidth = 0;
iColWidth = rcGrid.Width()/2;
m_grid.SetColWidth(0, iColWidth); //not half width of the rect!
m_grid.SetColWidth(1, iColWidth); //not half width of the rect!BTW, is there any links I can get help of MS FlexGrid or code samples? So I don't have to ask every functions here!
modified on Monday, August 25, 2008 4:21 AM
Need your help!