: : : : I have an application MFC Wizard (exe) in mode SDI , I want to creat
: : : : a scrollbar in my program . Can you help me step by step ? Thank you
: : : : very much .
: : : :
: : :
When you create your CView-based class specify
: : : WS_VSCROLL style and that should do it.
: :
: : I don't understand . Can you help me again?
: :
: : I have an application ( SDI ) like the Wordpad Window Program, and
: : when i touch many words , i can not see all them because i have not
: : a scrollbar . It is my problem .
: :
: :
: :
:
: Find this code in your MFC application and add a scroll bar style
: (RED):
:
:
:
: int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
: {
: if (CFrameWnd::OnCreate(lpCreateStruct) == -1)
: return -1;
:
: // create a view to occupy the client area of the frame
: if (!m_wndView.Create(NULL, NULL, AFX_WS_DEFAULT_VIEW | WS_VSCROLL,
: CRect(0, 0, 0, 0), this, AFX_IDW_PANE_FIRST, NULL))
: {
: TRACE0("Failed to create view window\n");
: return -1;
: }
: return 0;
: }
: :
:
: Now, add the scrolling handler to your CView-based window:
: :
: void CChildView::OnVScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar)
: {
: }
: :
:
In my file mainframe , i only see some code :
int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
if (CFrameWnd::OnCreate(lpCreateStruct) == -1)
return -1;
if (!m_wndToolBar.CreateEx(this, TBSTYLE_FLAT, WS_CHILD | WS_VISIBLE | CBRS_TOP
| CBRS_GRIPPER | CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC) ||
!m_wndToolBar.LoadToolBar(IDR_MAINFRAME))
{
TRACE0("Failed to create toolbar\n");
return -1; // fail to create
}
if (!m_wndStatusBar.Create(this) ||
!m_wndStatusBar.SetIndicators(indicators,
sizeof(indicators)/sizeof(UINT)))
{
TRACE0("Failed to create status bar\n");
return -1; // fail to create
}
// TODO: Delete these three lines if you don't want the toolbar to
// be dockable
m_wndToolBar.EnableDocking(CBRS_ALIGN_ANY);
EnableDocking(CBRS_ALIGN_ANY);
DockControlBar(&m_wndToolBar);
return 0;
}
I dont see things you talk to me ???