Set the msflexgrid col width and row height according client rect [modified]
-
how to set the col width and row height according client rect and make the cells full fill with the client area. I calc the value as follow way, but it still can't meet the rect.... BOOL CPgDialog::OnInitDialog() { CRect clrect; long row=0,col=0; m_grid.SetRows(20); // total rows 20 m_grid.SetCols(20); // total cols 20 m_grid.GetClientRect(&clrect); long lwidth =clrect.Width()/m_grid.GetRows()*14.4; // inch? long lheight = clrect.Height()/m_grid.GetCols()*14.4; for (col=0;col< m_grid.GetCols();col++) { m_grid.SetColWidth(col,lwidth); } for (row=0;row
-
how to set the col width and row height according client rect and make the cells full fill with the client area. I calc the value as follow way, but it still can't meet the rect.... BOOL CPgDialog::OnInitDialog() { CRect clrect; long row=0,col=0; m_grid.SetRows(20); // total rows 20 m_grid.SetCols(20); // total cols 20 m_grid.GetClientRect(&clrect); long lwidth =clrect.Width()/m_grid.GetRows()*14.4; // inch? long lheight = clrect.Height()/m_grid.GetCols()*14.4; for (col=0;col< m_grid.GetCols();col++) { m_grid.SetColWidth(col,lwidth); } for (row=0;row