R
Ricky W. Hunt
Is there a way to prevent such events as TrackBar1.ValueChanged from firing
during initialization? I'm using a TrackBar control to control the volume of
media player app I wrote. The problem is the buffer for playback doesn't
exist until the user opens a media file. On startup the value of the slider
is set to -600 using the Designer. For some reason (because the value is not
zero???) this causes it to execute the "valuechanged" subroutine which tries
to apply volume changes to a non-existent buffer and throws an error.
There's a couple of things that happens like this in the program and so far
the only solution I've come up with is the ugly "If FirstTime Then...Else"
type of code. Is there a way to stop those events from triggering on
initialization or am I approaching this wrong?
during initialization? I'm using a TrackBar control to control the volume of
media player app I wrote. The problem is the buffer for playback doesn't
exist until the user opens a media file. On startup the value of the slider
is set to -600 using the Designer. For some reason (because the value is not
zero???) this causes it to execute the "valuechanged" subroutine which tries
to apply volume changes to a non-existent buffer and throws an error.
There's a couple of things that happens like this in the program and so far
the only solution I've come up with is the ugly "If FirstTime Then...Else"
type of code. Is there a way to stop those events from triggering on
initialization or am I approaching this wrong?