Solved

CSliderCtrl Click

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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
groupSumClump challenge 9 125
Issues with C++ Class 19 101
Embarcadero C++ builder XE10.1 Berlin TRegistry declaration 1 40
Why is initMap returning "not a function" error. 3 32
This article will show, step by step, how to integrate R code into a R Sweave document
Whether you’re a college noob or a soon-to-be pro, these tips are sure to help you in your journey to becoming a programming ninja and stand out from the crowd.
The viewer will learn how to pass data into a function in C++. This is one step further in using functions. Instead of only printing text onto the console, the function will be able to perform calculations with argumentents given by the user.
In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …

828 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