Solved

CSliderCtrl Click

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

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

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

Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
Container Orchestration platforms empower organizations to scale their apps at an exceptional rate. This is the reason numerous innovation-driven companies are moving apps to an appropriated datacenter wide platform that empowers them to scale at a …
The viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

776 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