Click here to Skip to main content
16,005,734 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralIE plugin Pin
xxhimanshu6-Dec-02 19:20
xxhimanshu6-Dec-02 19:20 
GeneralRe: IE plugin Pin
Laurent Michalkovic6-Dec-02 21:52
Laurent Michalkovic6-Dec-02 21:52 
GeneralRe: IE plugin Pin
xxhimanshu6-Dec-02 22:53
xxhimanshu6-Dec-02 22:53 
General#import directive Pin
nebbish6-Dec-02 19:02
nebbish6-Dec-02 19:02 
GeneralRe: #import directive Pin
Michael Dunn6-Dec-02 20:25
sitebuilderMichael Dunn6-Dec-02 20:25 
GeneralCListCtrl: What message to use for an event handler.. Pin
trustno16-Dec-02 17:22
trustno16-Dec-02 17:22 
GeneralRe: CListCtrl: What message to use for an event handler.. Pin
Michael Dunn6-Dec-02 20:32
sitebuilderMichael Dunn6-Dec-02 20:32 
GeneralMoving a single control in on HScroll in a CScrollView class Pin
VanHlebar6-Dec-02 16:10
VanHlebar6-Dec-02 16:10 
I need to move just a single control in my view to keep it centered on the screen. I have tried overriding the OnHScroll() and adding code to MoveWindow() for my control to move it. I can't seem to keep it visible.

Here is the code sample:

<br />
void CMYView::OnHScroll(UINT nSBCode, UINT nPos, CScrollBar *pScrollBar)<br />
{<br />
	CRect r;<br />
	int nNewCalPos;<br />
<br />
	if(pScrollBar) return;		//should be NULL;<br />
<br />
	switch(nSBCode)<br />
	{<br />
	case SB_LINERIGHT:<br />
		m_nHPos += 204;<br />
		if(m_nHPos > m_nMaxRange)<br />
		{<br />
			m_nHPos = m_nMaxRange;<br />
			nNewCalPos = m_nMaxRange - 204;<br />
		}<br />
		break;<br />
	case SB_LINELEFT:<br />
		m_nHPos -= 204;<br />
		if(m_nHPos < 0)<br />
		{<br />
			m_nHPos = 0;<br />
			nNewCalPos = 150;<br />
		}<br />
		break;<br />
	}<br />
<br />
	CScrollView::OnHScroll(nSBCode, nPos, pScrollBar);<br />
<br />
	//Size the control<br />
	m_cCalanderCtrl.GetMinReqRect(&r);<br />
	m_cCalanderCtrl.MoveWindow(nNewCalPos, 0, ((r.right * 4) + 20), r.bottom, TRUE);<br />
}<br />


Any ideas?

Thanks,
-Eric
Questionhow to read data into an array in visual c++ Pin
KBL6-Dec-02 14:46
KBL6-Dec-02 14:46 
AnswerRe: how to read data into an array in visual c++ Pin
Christian Graus6-Dec-02 14:51
protectorChristian Graus6-Dec-02 14:51 
GeneralRe: how to read data into an array in visual c++ Pin
KBL6-Dec-02 15:16
KBL6-Dec-02 15:16 
GeneralRe: how to read data into an array in visual c++ Pin
Christian Graus6-Dec-02 15:27
protectorChristian Graus6-Dec-02 15:27 
GeneralRe: how to read data into an array in visual c++ Pin
KBL6-Dec-02 16:10
KBL6-Dec-02 16:10 
GeneralRe: how to read data into an array in visual c++ Pin
Nitron7-Dec-02 4:50
Nitron7-Dec-02 4:50 
QuestionFiles: What is more efficient? Pin
AlexMarbus6-Dec-02 12:51
AlexMarbus6-Dec-02 12:51 
AnswerRe: Files: What is more efficient? Pin
Nitron6-Dec-02 13:36
Nitron6-Dec-02 13:36 
GeneralRe: Files: What is more efficient? Pin
AlexMarbus6-Dec-02 13:37
AlexMarbus6-Dec-02 13:37 
AnswerRe: Files: What is more efficient? Pin
Michael Dunn6-Dec-02 14:13
sitebuilderMichael Dunn6-Dec-02 14:13 
GeneralRe: Files: What is more efficient? Pin
AlexMarbus6-Dec-02 14:19
AlexMarbus6-Dec-02 14:19 
QuestionHow to tell if a file is opened? Pin
Jonathan Gilligan6-Dec-02 12:34
Jonathan Gilligan6-Dec-02 12:34 
AnswerRe: How to tell if a file is opened? Pin
Ravi Bhavnani6-Dec-02 13:06
professionalRavi Bhavnani6-Dec-02 13:06 
GeneralRe: How to tell if a file is opened? Pin
Jonathan Gilligan6-Dec-02 13:27
Jonathan Gilligan6-Dec-02 13:27 
GeneralMystery Progress Bars in Shell Context Menu Extension DLL Pin
Sheri Steeves6-Dec-02 11:28
Sheri Steeves6-Dec-02 11:28 
GeneralRestore focus to child window in CScrollView Pin
Sara Burns6-Dec-02 10:54
Sara Burns6-Dec-02 10:54 
GeneralWindows 2000 VS. NT Pin
Shay Harel6-Dec-02 10:41
Shay Harel6-Dec-02 10:41 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.