void MyScrollBarExample() { CScrollBar wScrollBar; wScrollBar.Create(IDD_SCROLLBAR, this); // 设置滚动条宽度为 100 像素,位置为 10 像素 wScrollBar.SetScrollsizes(100, 10); } ``` 总结:MFC 中的 SetScrollsizes 函数为开发者提供了一种方便的方式来设置滚动条的尺寸,从而提高用户操作的便捷性。...
void CMyScrollView::OnUpdate(CView* /*pSender*/, LPARAM /*lHint*/, CObject* /*pHint*/) { // Implement a GetMyDocSize() member function in // your document class; it returns a CSize. CMyScrollDoc* pMyDoc = (CMyScrollDoc*)GetDocument(); SetScrollSizes(MM_LOENGLISH, pMyDoc->Get...
voidCMyScrollView::OnUpdate(CView*/*pSender*/, LPARAM/*lHint*/, CObject*/*pHint*/) {// Implement a GetMyDocSize() member function in// your document class; it returns a CSize.CMyScrollDoc* pMyDoc = (CMyScrollDoc*)GetDocument(); SetScrollSizes(MM_LOENGLISH, pMyDoc->GetMyDocSize(...
SetScrollSizes(nMapMode, CSize(100,100)); 必须将映射的架构到任何Windows映射除MM_ISOTROPIC或MM_ANISOTROPIC您的架构。如果要使用一个不受约束的映射模式,请调用SetScaleToFitSize成员函数而不是SetScrollSizes。 示例 c++复制 voidCMyScrollView::OnUpdate(CView*/*pSender*/, LPARAM/*lHint*/, CObject*/*pHint...
void CScaleView::OnUpdate( ) { // ... // Implement a GetDocSize( ) method in // your document class; it returns a CSize. SetScrollSizes( MM_LOENGLISH, GetDocument( )->GetDocSize( ) ); ResizeParentToFit( ); // Default bShrinkOnly argument // ... } // another example void CMy...
新建时基类选CScrollView就行了
voidCMyScrollView::OnUpdate(CView*/*pSender*/, LPARAM/*lHint*/, CObject*/*pHint*/) {// Implement a GetMyDocSize() member function in// your document class; it returns a CSize.CMyScrollDoc* pMyDoc = (CMyScrollDoc*)GetDocument(); SetScrollSizes(MM_LOENGLISH, pMyDoc->GetMyDocSize(...
void CMyScrollView::OnUpdate(CView* /*pSender*/, LPARAM /*lHint*/, CObject* /*pHint*/) { // Implement a GetMyDocSize() member function in // your document class; it returns a CSize. CMyScrollDoc* pMyDoc = (CMyScrollDoc*)GetDocument(); SetScrollSizes(MM_LOENGLISH, pMyDoc->Get...
voidCMyScrollView::OnUpdate(CView*/*pSender*/, LPARAM/*lHint*/, CObject*/*pHint*/) {// Implement a GetMyDocSize() member function in// your document class; it returns a CSize.CMyScrollDoc* pMyDoc = (CMyScrollDoc*)GetDocument(); SetScrollSizes(MM_LOENGLISH, pMyDoc->GetMyDocSize(...
void CMyScrollView::OnUpdate(CView* /*pSender*/, LPARAM /*lHint*/, CObject* /*pHint*/) { // Implement a GetMyDocSize() member function in // your document class; it returns a CSize. CMyScrollDoc* pMyDoc = (CMyScrollDoc*)GetDocument(); SetScrollSizes(MM_LOENGLISH, pMyDoc->Get...