Visual C++

Moderators: Lundin
Number of threads: 379
Number of posts: 695

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

Report
how to creat a scrollbar in mode SDI ??? Posted by nhocgruby on 5 Nov 2008 at 10:20 AM
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 .
Report
Re: how to creat a scrollbar in mode SDI ??? Posted by AsmGuru62 on 6 Nov 2008 at 4:52 AM
: 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.
Report
Re: how to creat a scrollbar in mode SDI ??? Posted by nhocgruby on 6 Nov 2008 at 6:32 AM
: : 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 .


Report
Re: how to creat a scrollbar in mode SDI ??? Posted by AsmGuru62 on 7 Nov 2008 at 5:26 AM
: : : 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)
{
}

Report
Re: how to creat a scrollbar in mode SDI ??? Posted by nhocgruby on 10 Nov 2008 at 8:48 AM
: : : : 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 ???




 

Recent Jobs

Official Programmer's Heaven Blogs
Web Hosting | Browser and Social Games | Gadgets

Popular resources on Programmersheaven.com
Assembly | Basic | C | C# | C++ | Delphi | Flash | Java | JavaScript | Pascal | Perl | PHP | Python | Ruby | Visual Basic
© Copyright 2011 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Operated by CommunityHeaven, a BootstrapLabs company.