public void SetUp() { subForm = Mock.Create <SubForm>(Behavior.Strict); subject = new LookupControl(); subject.SubFormFactory = () => subForm; }
private void metroTile1_Click(object sender, EventArgs e) { this.Visible = false; SubForm search = new SubForm(); search.Location = this.Location; search.ShowDialog(); this.Close(); }
private void Clicked_Button(object sender, EventArgs e) { if (formStack.Count < 3) { SubForm sub = new SubForm(); sub.Visible = true; } else { MessageBox.Show("더 이상 생성할수 없습니다.", "No"); } }
/// <summary> /// 监听到事件后的事件处理程序 /// </summary> /// <param name="eventObject"></param> private void OnClickEventReceived(ShowDialogEventSourceObject eventObject) { if (MessageBox.Show("您确定要打开新弹窗吗?", "提示", MessageBoxButtons.OKCancel, MessageBoxIcon.Information) != DialogResult.OK) { return; } using (SubForm dialog = new SubForm(eventObject?.ClickInfo)) { dialog.ShowDialog(); eventObject?.Callback?.Invoke(true, eventObject?.ClickInfo); } }
private void Sum_Click(object sender, EventArgs e) { if (Application.OpenForms.Count > 0) { Application.OpenForms[0].Activate(); } else { SubForm subForm = new SubForm(encoding); subForm.ShowDialog(); } }
private void addButton_Click(object sender, EventArgs e) { SubForm sub = new SubForm(Buyers, Items); sub.ShowDialog(); if (sub.DialogResult == DialogResult.OK) { foreach (Order o in sub.results) { orderService.AddOrder(o); } orderService.OrderBy(); orderBindingSource.ResetBindings(false); } }
private void AbrirForm <SubForm>() where SubForm : Form, new() { Form frmChild = new Form(); frmChild = pnlChildForms.Controls.OfType <SubForm>().FirstOrDefault(); if (frmChild == null) { frmChild = new SubForm(); frmChild.TopLevel = false; frmChild.Dock = DockStyle.Fill; pnlChildForms.Controls.Add(frmChild); pnlChildForms.Tag = frmChild; frmChild.Show(); frmChild.BringToFront(); } else { frmChild.BringToFront(); } }
private void modifyButton_Click(object sender, EventArgs e) { Order current = new Order(); current = (Order)orderBindingSource.Current; SubForm sub = new SubForm(Buyers, Items, current) { Buyers = Buyers, Items = Items }; sub.ShowDialog(); if (sub.DialogResult == DialogResult.OK) { orderBindingSource.Remove(orderBindingSource.Current); foreach (Order o in sub.results) { orderService.AddOrder(o); } orderService.OrderBy(); orderBindingSource.ResetBindings(false); } }
public void MainForm_DestroyOldHandleWithThreadExit_CallsHandler() { var mainForm = new SubForm(); var newMainForm = new SubForm(); var context = new ApplicationContext(mainForm) { MainForm = newMainForm }; int callCount = 0; EventHandler handler = (sender, e) => { Assert.Same(context, sender); Assert.Same(EventArgs.Empty, e); callCount++; }; context.ThreadExit += handler; Assert.NotEqual(IntPtr.Zero, mainForm.Handle); Assert.Equal(0, callCount); Assert.NotEqual(IntPtr.Zero, newMainForm.Handle); Assert.Equal(0, callCount); mainForm.OnHandleDestroyed(EventArgs.Empty); Assert.Equal(0, callCount); newMainForm.OnHandleDestroyed(EventArgs.Empty); Assert.Equal(1, callCount); // Call again. mainForm.OnHandleDestroyed(EventArgs.Empty); Assert.Equal(1, callCount); newMainForm.OnHandleDestroyed(EventArgs.Empty); Assert.Equal(1, callCount); }
public void MainForm_RecreateHandleWithThreadExit_DoesNotCallHandler() { var mainForm = new SubForm(); var context = new ApplicationContext(mainForm); int callCount = 0; EventHandler handler = (sender, e) => { Assert.Same(context, sender); Assert.Same(EventArgs.Empty, e); callCount++; }; context.ThreadExit += handler; Assert.NotEqual(IntPtr.Zero, mainForm.Handle); Assert.Equal(0, callCount); mainForm.RecreateHandle(); Assert.Equal(0, callCount); // Call again. mainForm.RecreateHandle(); Assert.Equal(0, callCount); }
private void FiltrujTabelę(object sender, EventArgs e) { SubForm.FiltrujTabelę(this.filterBy.Text, this.filterValue.Text, ref this.karty_ocenBindingSource, this.bazaDanychDataSet.Karty_ocen); }
private void ResetujFiltr(object sender, EventArgs e) { SubForm.ResetujFiltr(ref this.filterValue, ref this.filterBy, ref this.nauczycieleBindingSource); }
private void FiltrujTabelę(object sender, EventArgs e) { SubForm.FiltrujTabelę(this.filterBy.Text, this.filterValue.Text, ref this.nauczycieleBindingSource, this.bazaDanychDataSet.Nauczyciele); }
private void SygnalizujZamknięcie(object sender, FormClosedEventArgs e) { SubForm.SygnalizuZamknięcie(ref main, CurrentSubForm.NauczycielePrzeglądanie); }
public RoleUcForm(SubForm ownerForm) { InitializeComponent(); this._ownerFrom = ownerForm; }
private void SygnalizuZamknięcie(object sender, FormClosedEventArgs e) { SubForm.SygnalizuZamknięcie(ref main, CurrentSubForm.KartyOcenPrzeglądanie); }
private void ResetujFiltr(object sender, EventArgs e) { SubForm.ResetujFiltr(ref this.filterValue, ref this.filterBy, ref this.karty_ocenBindingSource); }
public PgmTransferWarningSettingForm(SubForm ownerForm) { InitializeComponent(); this._ownerFrom = ownerForm; }
public ShippingAddressForm(SubForm ownerForm) { InitializeComponent(); this._ownerFrom = ownerForm; }
private void FiltrujTabelę(object sender, EventArgs e) { SubForm.FiltrujTabelę(this.filterBy.Text, this.filterValue.Text, ref this.plan_zajęćBindingSource, this.bazaDanychDataSet.Plan_zajęć); }
public ShippingInfoConfirmOrderForm(SubForm ownerForm) { InitializeComponent(); this._ownerFrom = ownerForm; }
public CurrencyForm(SubForm ownerForm) { InitializeComponent(); this._ownerFrom = ownerForm; }
public WarehouseForm(SubForm ownerForm) { InitializeComponent(); this._ownerFrom = ownerForm; }
private void 두번째폼열기ToolStripMenuItem_Click(object sender, EventArgs e) { SubForm sub = new SubForm(); sub.Visible = true; }
private void FiltrujTabelę(object sender, EventArgs e) { SubForm.FiltrujTabelę(this.filterBy.Text, this.filterValue.Text, ref this.rodzaje_pracBindingSource, this.bazaDanychDataSet.Rodzaje_prac); }
private void ResetujFiltr(object sender, EventArgs e) { SubForm.ResetujFiltr(ref this.filterValue, ref this.filterBy, ref this.rodzaje_pracBindingSource); }
public BusinessTypeForm(SubForm ownerForm) { InitializeComponent(); this._ownerFrom = ownerForm; }
public ItemKindForm(SubForm ownerForm) { InitializeComponent(); this._ownerFrom = ownerForm; }
public TaskNotifyOrderForm(SubForm ownerForm) { InitializeComponent(); this._ownerFrom = ownerForm; }
public ProjectForm(SubForm ownerForm) { InitializeComponent(); this._ownerFrom = ownerForm; }