15,979
社区成员
发帖
与我相关
我的任务
分享
void CZoomView::OnInitialUpdate()
{
CScrollView::OnInitialUpdate();
m_layout.cx = 2000;
m_layout.cy = 1000;
m_page.cx = m_layout.cx/2;
m_page.cy = m_layout.cy/2;
m_line.cx = m_layout.cx/50;
m_line.cy = m_layout.cy/50;
SetScrollSizes(MM_TEXT, m_layout, m_page, m_line);
m_bInitialSize = TRUE;
if (m_pdcMemory->GetSafeHdc() == NULL)
{
CClientDC dc(this);
OnPrepareDC(&dc);
m_pdcMemory->CreateCompatibleDC(&dc);
// makes bitmap same size as display window
CRect clientRect(0,0,0,0);
GetClientRect(clientRect);
if (m_pBitmap != NULL)
{
delete m_pBitmap;
m_pBitmap = NULL;
}
m_pBitmap = new CBitmap();
m_pBitmap->CreateCompatibleBitmap(&dc, clientRect.right,
clientRect.bottom);
}
////////////////////////////////////////////////////
CRect rect;
GetWindowRect(&rect);
rect.left = 0;
rect.top = 0;
rect.right = 1800;
rect.bottom = 700;
//虚拟列表,用于限制一次性限制多少数据,防止界面卡http://blog.csdn.net/milanleon/article/details/29195657 滚动条//WS_VSCROLL和WS_HSCROLL
g_pFlyCaptureView->m_userMamagerDada->Create(/*WS_CHILD|WS_VISIBLE|*/WS_BORDER|LVS_REPORT|LVIS_FOCUSED|WS_VSCROLL|WS_HSCROLL|LVS_SHOWSELALWAYS, rect, this, 1500);
//样式扩展
g_pFlyCaptureView->m_userMamagerDada->SetExtendedStyle(LVS_SHOWSELALWAYS|LVS_EX_CHECKBOXES|LVS_EX_FULLROWSELECT|LVS_EX_GRIDLINES|LVS_EX_GRIDLINES);
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
}
列表数据是通过一个对话框的数据查询得来void CpreviewDlg::OnSize(UINT nType, int cx, int cy)
{
CDialog::OnSize(nType, cx, cy);
// TODO: 在此处添加消息处理程序代码
CRect rc;
GetClientRect(&rc);
const int width = 96;
int y = rc.Height()/2 + 0;
CWnd *pWnd = GetDlgItem(IDC_STATIC_SCREEN);//你的listcontrl的位置
if (pWnd && IsWindow(pWnd->m_hWnd))
{
pWnd->SetWindowPos(NULL, cx - 120,cy/2 - 50, 90, 90, NULL);//位置你自己调整
}
}