Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

CSliderCtrl Click

Posted on 2011-03-02
1
Medium Priority
?
737 Views
Last Modified: 2012-05-11
Hello,
I use a CSliderCtrl and the HScroll for the position change. This works well for move the thumb, but it do not work if I click into the line. Normaly if I click into the line, the tumb will go to this position. How I have to expand the HScroll that it will be work.
Attached the function I use currently.

Ocrana
void CAudioGrabSource::OnHScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar)
{
	if (pScrollBar->GetSafeHwnd() == mAGrabPlayPos.GetSafeHwnd())
	{
		switch (nSBCode)
		{
		case TB_PAGEDOWN:
			case SB_THUMBTRACK:
				m_bScrolling = true;
				break;

			case SB_THUMBPOSITION:
				m_cAudioTrackPlayer.Seek((float)mAGrabPlayPos.GetPos());
				break;
		
			case SB_ENDSCROLL:
				m_bScrolling = false;
				break;

			default:
				break;
		}
	}

	__super::OnHScroll(nSBCode, nPos, pScrollBar);
}

Open in new window

0
Comment
Question by:Ocrana
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 31

Accepted Solution

by:
Zoppo earned 2000 total points
ID: 35018728
Hi Ocrana,

>> Normaly if I click into the line, the tumb will go to this position.
I don't think this is the default behavior - at least I cannot reproduce this with a normal slider control added to a dialog. When clicking on the line depending on the position relative to the slider's handle a 'SB_PAGEUP' or 'SB_PAGEDOWN' scroll message is sent, then the handle moves a given amount (which you can set with CSliderCtrl::SetPageSize) toward the position where the line was clicked.

ZOPPO
0

Featured Post

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Computer science students often experience many of the same frustrations when going through their engineering courses. This article presents seven tips I found useful when completing a bachelors and masters degree in computing which I believe may he…
Today, the web development industry is booming, and many people consider it to be their vocation. The question you may be asking yourself is – how do I become a web developer?
The viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…

704 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question