Solved

CSliderCtrl Click

Posted on 2011-03-02
1
732 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 500 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

[Webinar] Learn How Hackers Steal Your Credentials

Do You Know How Hackers Steal Your Credentials? Join us and Skyport Systems to learn how hackers steal your credentials and why Active Directory must be secure to stop them. Thursday, July 13, 2017 10:00 A.M. PDT

Question has a verified solution.

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

In this post we will learn different types of Android Layout and some basics of an Android App.
The SignAloud Glove is capable of translating American Sign Language signs into text and audio.
The goal of the video will be to teach the user the difference and consequence of passing data by value vs passing data by reference in C++. An example of passing data by value as well as an example of passing data by reference will be be given. Bot…
Starting up a Project

623 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