/// <summary> /// This is not an actual constructor but the code runs whenever the User Control gets visible. /// </summary> private void UCBooks_VisibleChanged(object sender, EventArgs e) { if (Visible) { UIExtension.ClearSearch(lvSearchAuthor, lvSearchBook, txtSearch, rbtnAuthor, rbtnBook, pnlSearch, drdwnBookSearchBy, txtSearchPlaceholder); } }
private void lvSearchBook_KeyDown(object sender, KeyEventArgs e) { if (e.KeyCode == Keys.Escape) { UIExtension.ClearSearch(lvSearchAuthor, lvSearchBook, txtSearch, rbtnAuthor, rbtnBook, pnlSearch, drdwnBookSearchBy, txtSearchPlaceholder); } }
// <-- Constructors. // <-- Constructors. // Local methods. --> private void LoadNewLoan() { lblTitle.Text = "New loan"; txtSearch.Enabled = true; lblTodaysDate.Visible = false; UIExtension.ToggleListViewSearch(lvNewLoan, lvReturnLoan); UIExtension.ClearSearch(lvNewLoan, txtSearch, txtSearchPlaceholder, rbtnBook, rbtnMember, false); }
/// <summary> /// This is not an actual constructor but the code runs whenever the User Control gets visible. /// </summary> private void UCMembers_VisibleChanged(object sender, EventArgs e) { if (Visible) { txtSearch.Text = ""; UIExtension.ClearSearch(lvMembers, txtSearch, txtSearchPlaceholder); } }
// <-- Focus events. // Key press events.--> private void txtSearch_KeyDown(object sender, KeyEventArgs e) { if (e.KeyCode == Keys.Escape) { UIExtension.ClearSearch(lvMembers, txtSearch, txtSearchPlaceholder); ActiveControl = null; } }
private void LoadReturnLoan() { lblTitle.Text = "Return loan"; txtSearch.Enabled = false; lblTodaysDate.Visible = true; lblTodaysDate.Text = DateTime.Today.ToShortDateString(); UIExtension.ToggleListViewSearch(lvReturnLoan, lvNewLoan); UIExtension.ClearSearch(lvReturnLoan, txtSearch, txtSearchPlaceholder, rbtnBook, rbtnMember, true); }