How does slider control implement where the mouse clicks and where the slider moves?

Source: Internet
Author: User

Vs 2008

MFC

C ++

Win7 64bit

If you want the slider control to achieve the effect of moving the slider to where the mouse clicks it, just like the progress bar and volume of the player

When a normal slider control is clicked, only a fixed Distance length will be moved.

So I thought of reloading this class and implementing this function myself.

An article found onlineArticle

Http://blog.csdn.net/shen_wei/article/details/6692458

But there is still a problem,

1. When you want to pull the slider, it is difficult to get the slider with the mouse (when you click the mouse, you can directly respond to the overloaded lbuttondown function)

2. When the mouse clicks slider to the rightmost, it will jump directly to the end, which is very strange and cannot find the reason (in this case, someone asked online, but I cannot find the webpage)

After thinking a lot of ways, I feel like this is definitely not possible.

Then I went to the codeproject to find the ready-made controls. It took a long time to find them.

Cbitmapslider

Http://www.codeproject.com/Articles/4850/CBitmapSlider

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.