How do I get notified when a TrackBar changes value?

G

Guest

I am developing a C# application on HP iPAQ, Pocket PC 2003. I want to use a
TrackBar. I do not see in the class definition support for the compact
framework to handle any of the events that indicate the "Value" property has
changed (ie no scroll or click or mouse up/down events). I found a sample
that said to do:

this.mtrackBarVolume.Scroll += new
System.EventHandler(this.trackBarVolume_Scroll);

and then make a method:
private void trackBarVolume_Scroll(object sender, System.EventArgs e)
{
// store the trackbar value
mCurVol = trackBar1.Value;
}

but this is not supported by compact framework. Any suggestions are
appreciated
 
G

Guest

Thank you. I did not know what to try cause the reference I rely on
http://msdn.microsoft.com/library/d...lrfSystemWindowsFormsTrackBarMembersTopic.asp

Usually says "Supported by the .NET Compact Framework." if it can be used in
Compact Framework.

My new problem is that "ValueChanged" give tooo much information. I only
want to know the very LAST value the TrackBar stopped at. I am setting
volume and
I do not want to change every time the TrackBar value changes. I want to
know the where the TrackBar stopped moving (like say "MouseUp"). I tried
MouseUp it does
not seemed to be called for TrackBar. I have a touch screen. I assumed
"mouse" was
the same as "stylus". Thanks for your help so far. Please let me know if
you have
another suggestion.
Maria

Daniel Moth said:
How about ValueChanged?

Cheers
Daniel
 
D

Daniel Moth

Yes the "supported" comment in documentation is not good for events:
http://www.danielmoth.com/Blog/2005/04/intellisense-for-smart-device-project.html

Personally, I would change the volume every time the event fires and hence
give real feedback to the user - they'll appreciate it. Would you want your
TV reacting to the volume change only after you paused?

Anyway, if you really want to, you could start a timer in the ValueChanged
with an interval you deem acceptable (e.g. 750 millis) and only then take
action on the value (every time the ValueChanged fires you restart the timer
of course).

Cheers
Daniel
--
http://www.danielmoth.com/Blog/


mcruz said:
Thank you. I did not know what to try cause the reference I rely on:
http://msdn.microsoft.com/library/d...lrfSystemWindowsFormsTrackBarMembersTopic.asp

Usually says "Supported by the .NET Compact Framework." if it can be used
in
Compact Framework.

My new problem is that "ValueChanged" give tooo much information. I only
want to know the very LAST value the TrackBar stopped at. I am setting
volume and
I do not want to change every time the TrackBar value changes. I want to
know the where the TrackBar stopped moving (like say "MouseUp"). I tried
MouseUp it does
not seemed to be called for TrackBar. I have a touch screen. I assumed
"mouse" was
the same as "stylus". Thanks for your help so far. Please let me know if
you have
another suggestion.
Maria
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top