private void xtraTabControl2_SelectedPageChanging(object sender, DevExpress.XtraTab.TabPageChangingEventArgs e) { if (xtraTabControl2.TabPages.Count <= 0 || xtraTabControl2.SelectedTabPageIndex < 0) { return; } UserControl1 uc = this.xtraTabControl2.TabPages[xtraTabControl2.SelectedTabPageIndex].Controls[0] as UserControl1; e.Cancel = uc.CheckIsSampling(); }
protected virtual void UserSelectedPageChanging(object sender, DevExpress.XtraTab.TabPageChangingEventArgs e) { RaiseEvent(sender, "SelectedPageChanging", e); }