Solved

CSliderCtrl Click

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

Accepted Solution

by:
Zoppo earned 500 total points
Comment Utility
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

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
topping1 challenge 7 47
topping3 challenge 14 48
Magic Software info 18 100
drawing animated level bar based on numbers 3 70
Here we come across an interesting topic of coding guidelines while designing automation test scripts. The scope of this article will not be limited to QTP but to an overall extent of using VB Scripting for automation projects. Introduction Now…
Displaying an arrayList in a listView using the default adapter is rarely the best solution. To get full control of your display data, and to be able to refresh it after editing, requires the use of a custom adapter.
An introduction to basic programming syntax in Java by creating a simple program. Viewers can follow the tutorial as they create their first class in Java. Definitions and explanations about each element are given to help prepare viewers for future …
The viewer will learn how to use the return statement in functions in C++. The video will also teach the user how to pass data to a function and have the function return data back for further processing.

762 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now