-
April 12th, 2010, 04:22 AM
#1
progress bar mouse events
Is there a way to change the position of progress bar with mouse events in mfc?
-
April 12th, 2010, 04:55 AM
#2
Re: progress bar mouse events
Just use CProgressCtrl methods to advance the progress bar position (like CProgressCtrl::SetPos and so on).
Of course, you can call them from any mouse message handler.
Victor Nijegorodov
-
April 12th, 2010, 05:03 AM
#3
Re: progress bar mouse events
I want to set position with the mouse, at mouse events, the event argument is a point, is there any way to match it to the position of progress bar. I need something lbutton_down event of progress control with the event argument as position, not point.
-
April 12th, 2010, 05:24 AM
#4
Re: progress bar mouse events
Have you considered using a CSliderCtrl ? This is made exactly for what you are trying to do.
-
April 12th, 2010, 06:03 AM
#5
Re: progress bar mouse events
yes, I know about slider. as functionality it gives what I want but as view it does not. It does not fill the rect progressively. What I am trying to do is just in between slider and progress controlls. functionality like slider, view as progress bar.
-
April 12th, 2010, 03:55 PM
#6
Re: progress bar mouse events
I need something lbutton_down event of progress control with the event argument as position, not point.
If you know the point, you can calculate the position.
example:
The scrollbar has a window clientarea-width of 300.
You scrollbar goes from 1 to 100.
300 / 100 = 3. So 3 pixels is 1 position in the scrollbar.
The mouse point inside the scrollbar window is (12, 3). Ignore the 3, the 12 is the x.
So the scrollbar position is 12 / (300 / 100) = 4.
Last edited by Skizmo; April 12th, 2010 at 03:57 PM.
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|