private void AddAddress(Address address) { if (address.IsActive) { TabPage tabPage = new TabPage("Address"); AddressUserControl addressUC = new AddressUserControl(address); tabPage.Controls.Add(addressUC); m_AddressTabControl.TabPages.Add(tabPage); } }
private void m_DeleteAddressButton_Click(object sender, EventArgs e) { if (m_AddressTabControl.SelectedTab != null) { AddressUserControl control = GetControl(m_AddressTabControl.SelectedTab, typeof(AddressUserControl)) as AddressUserControl; control.Address.IsActive = false; } LoadAddresses(); }