可是我就是用OnDraw()
来填充FlexGrid的啊:
CXXXView::OnDraw()
{
CString strFilter;
CRect rect;
long i;
long lWidth;
int iRecordNums;
int iCurRow;
CString strCell;
iCurRow = 1;
GetClientRect(&rect);
lWidth = rect.Width();
for ( i = 0; i < 5; i++ )
{
m_FlexGrid.SetColWidth(i, lWidth * 2.97);
}
if ( m_pSet->IsEOF() )
m_FlexGrid.SetRows(1);
else
{
if ( !m_pSet->IsEOF())
{
m_pSet->MoveNext();
}
iRecordNums = m_pSet->GetRecordCount();
m_FlexGrid.SetRows(iRecordNums + 1);
m_pSet->MoveFirst();
while ( iCurRow < iRecordNums + 1 )
{
m_FlexGrid.SetRow(iCurRow);
m_FlexGrid.SetCol(0);
m_FlexGrid.SetText(m_pSet->m_strName);
m_FlexGrid.SetCol(1);
strCell.Format("%d", m_pSet->m_lCode);
m_FlexGrid.SetText(strCell);
m_FlexGrid.SetCol(2);
strCell.Format("%d", m_pSet->m_lDays);
m_FlexGrid.SetText(strCell);
m_FlexGrid.SetCol(3);
strCell.Format("%d", m_pSet->m_lNumber);
m_FlexGrid.SetText(strCell);
m_FlexGrid.SetCol(4);
m_FlexGrid.SetText(m_pSet->m_strLevel); iCurRow += 1;
m_pSet->MoveNext();
}
}
m_FlexGrid.MoveWindow(&rect);
m_FlexGrid.RedrawWindow(&rect);
}
来填充FlexGrid的啊:
CXXXView::OnDraw()
{
CString strFilter;
CRect rect;
long i;
long lWidth;
int iRecordNums;
int iCurRow;
CString strCell;
iCurRow = 1;
GetClientRect(&rect);
lWidth = rect.Width();
for ( i = 0; i < 5; i++ )
{
m_FlexGrid.SetColWidth(i, lWidth * 2.97);
}
if ( m_pSet->IsEOF() )
m_FlexGrid.SetRows(1);
else
{
if ( !m_pSet->IsEOF())
{
m_pSet->MoveNext();
}
iRecordNums = m_pSet->GetRecordCount();
m_FlexGrid.SetRows(iRecordNums + 1);
m_pSet->MoveFirst();
while ( iCurRow < iRecordNums + 1 )
{
m_FlexGrid.SetRow(iCurRow);
m_FlexGrid.SetCol(0);
m_FlexGrid.SetText(m_pSet->m_strName);
m_FlexGrid.SetCol(1);
strCell.Format("%d", m_pSet->m_lCode);
m_FlexGrid.SetText(strCell);
m_FlexGrid.SetCol(2);
strCell.Format("%d", m_pSet->m_lDays);
m_FlexGrid.SetText(strCell);
m_FlexGrid.SetCol(3);
strCell.Format("%d", m_pSet->m_lNumber);
m_FlexGrid.SetText(strCell);
m_FlexGrid.SetCol(4);
m_FlexGrid.SetText(m_pSet->m_strLevel); iCurRow += 1;
m_pSet->MoveNext();
}
}
m_FlexGrid.MoveWindow(&rect);
m_FlexGrid.RedrawWindow(&rect);
}
解决方案 »
- 写了一个图片任意拉伸的处理,但效率比较低
- 插入链表的头结点:帮忙看一下为何会报错,马上给分!!!
- 绘图的问题
- VC自带的FLASH控件怎么用呀?????
- vc怎样才能连上oracle?
- 已知下载文件地URL,如何在程序中实现将它下载到我的本地机的某个确定目录中去。。。(不需要像IE下载文件那样跳出下载对话框)
- 用vfw的capCreateCaptureWindow创建出的视频窗如何响应鼠标事件?
- 我该如何同时重载 WM_LBUTTONDOWN 和 WM_LBUTTONDBCLK消息
- WIN98,如何实现开机中停止接受任何鼠标键盘消息,而到了自定义程序中才恢复
- 《深入浅出》 问题7 隆重出炉, 快来呀
- 这个如何解码??
- 请教SDK有关画刷的一个小问题
OnUpdate
上面应有个好使的,OnDraw没调用是常有的,经常被调用 的是OnPaint,而
Invalid等方式是后应UpdateWindow(TRUE)一下,别一个常被调用 的是
OnUpdate(..),建议不行的话放在这个函数中。