private async void DataBooks_MouseClick(object sender, MouseEventArgs e) { try { switch (e.Button) { case MouseButtons.Left when(DataBooks.CurrentRow.Selected): DataBooksInf.Rows.Clear(); for (int i = 0; i < Users[DataBooks.CurrentRow.Index].Count; i++) { int n = DataBooksInf.Rows.Add(); (DataBooksInf.Rows[n].Cells[0].Value, DataBooksInf.Rows[n].Cells[1].Value) = GetDataRow(Users[DataBooks.CurrentRow.Index][i]); } DataBooksInf.ClearSelection(); Delete.Enabled = true; Delete.Text = "Удалить книгу"; break; case MouseButtons.Middle: await helper.UnHideAllRowsAsyncUnsafe(DataBooks); DataBooks.ClearSelection(); DataBooksInf.Rows.Clear(); Delete.Text = "Удалить..."; Delete.Enabled = false; InfoLabelBookUserCount.Visible = InfoLabelBookUserCountValue.Visible = false; break; } } catch { } }
private void DataBooks_KeyDown(object sender, KeyEventArgs e) { if (e.KeyCode != Keys.Right || DataBooks.RowCount == 0 || !DataBooks.CurrentRow.Selected || DataBooksInf.RowCount == 0) { return; } DataBooksInf.Rows[0].Selected = true; DataBooksInf.Focus(); Delete.Text = "Убрать пользователя"; }
private void DataBooksInf_KeyDown(object sender, KeyEventArgs e) { if (e.KeyCode != Keys.Left) { return; } DataBooks.Focus(); Delete.Text = "Удалить книгу"; Delete.Enabled = true; DataBooksInf.ClearSelection(); }
private void DataBooks_KeyDown(object sender, KeyEventArgs e) { switch (e.KeyCode) { case Keys.Right when(DataBooks.RowCount != 0 || DataBooks.CurrentRow.Selected || DataBooksInf.RowCount != 0): DataBooksInf.Rows[0].Selected = true; DataBooksInf.Focus(); Delete.Text = "Убрать пользователя"; break; } }
private void DataBooks_SelectionChanged(object sender, EventArgs e) { if (DataBooks.RowCount == 0) { Delete.Enabled = false; Delete.Text = "Удалить..."; return; } DataBooksInf.Rows.Clear(); for (int i = 0; i < Users[DataBooks.CurrentRow.Index].Count; i++) { int n = DataBooksInf.Rows.Add(); (DataBooksInf.Rows[n].Cells[0].Value, DataBooksInf.Rows[n].Cells[1].Value) = GetDataRow(Users[DataBooks.CurrentRow.Index][i]); } DataBooksInf.ClearSelection(); InfoLabelBookUserCount.Visible = InfoLabelBookUserCountValue.Visible = true; InfoLabelBookUserCountValue.Text = DataBooksInf.RowCount.ToString(); Delete.Enabled = true; Delete.Text = "Удалить книгу"; }
private void DataBooksInf_MouseClick(object sender, MouseEventArgs e) { try { switch (e.Button) { case MouseButtons.Right: DataBooksInf.ClearSelection(); Delete.Enabled = false; Delete.Text = "Удалить..."; break; case MouseButtons.Left when(DataBooksInf.SelectedRows.Count == 1): Delete.Enabled = true; Delete.Text = "Убрать пользователя"; break; } } catch { } }