}//free video private void Video_Timer_Tick(object sender, EventArgs e) { string HH, MM, SS; if (Video_Timer_Enable) { VideoPosition = (int)vid.CurrentPosition; trackBar.Value = 10 * VideoPosition; hour = VideoPosition / 3600; minute = (VideoPosition - hour * 3600) / 60; second = (VideoPosition - hour * 3600 - minute * 60); HH = ("00" + hour.ToString()); HH = HH.Substring(HH.Length - 2, 2); MM = ("00" + minute.ToString()); MM = MM.Substring(MM.Length - 2, 2); SS = ("00" + second.ToString()); SS = SS.Substring(SS.Length - 2, 2); curTime.Text = HH + ":" + MM + ":" + SS; if (curTime.Text == Video_Time) { audio_stop_Click(null, null); } } }
private void Movie_Timer_Tick(object sender, EventArgs e) { string HH, MM, SS; if (Movie_Timer_Enabled) { MovieCurrentPosition = (int)Movie.CurrentPosition; Movie_Track.Value = 10 * MovieCurrentPosition; hours = MovieCurrentPosition / 3600; minutes = (MovieCurrentPosition - hours * 3600) / 60; seconds = (MovieCurrentPosition - hours * 3600 - minutes * 60); HH = ("00" + hours.ToString()); HH = HH.Substring(HH.Length - 2, 2); MM = ("00" + minutes.ToString()); MM = MM.Substring(MM.Length - 2, 2); SS = ("00" + seconds.ToString()); SS = SS.Substring(SS.Length - 2, 2); currentTime.Text = HH + ":" + MM + ":" + SS; if (currentTime.Text == movieDuration) { BTN_Stop_Click(null, null); } } DateTime dt = DateTime.Now; HH = ("00" + dt.Hour.ToString()); HH = HH.Substring(HH.Length - 2, 2); MM = ("00" + dt.Minute.ToString()); MM = MM.Substring(MM.Length - 2, 2); SS = ("00" + dt.Second.ToString()); SS = SS.Substring(SS.Length - 2, 2); ShowTime.Text = HH + ":" + MM + ":" + SS; }