private void frmVideo_FormClosing(object sender, FormClosingEventArgs e) { if (this.pnlVideo.Controls.Count > 0) { Control ctrl = this.pnlVideo.Controls[0]; UCBaseVideo oldVideo = ctrl as UCBaseVideo; oldVideo.CloseAllVideo(true); this.pnlVideo.Controls.Remove(ctrl); ctrl = null; } }
private bool IsVideoChange(Type videotype) { bool isChangle = false; if (this.pnlVideo.Controls.Count > 0) { Control ctrl = this.pnlVideo.Controls[0]; if (ctrl.GetType() != videotype) { UCBaseVideo oldVideo = ctrl as UCBaseVideo; oldVideo.CloseAllVideo(true); this.pnlVideo.Controls.Remove(ctrl); ctrl = null; isChangle = true; } } else { isChangle = true; } return(isChangle); }