Esempio n. 1
0
        //копировать в буфер обмена
        private void копироватьВБуферОбменаToolStripMenuItem_Click(object sender, EventArgs e)
        {
            int c = tabel_grid.Col;
            int r = tabel_grid.Row;

            if (tabel_grid.Col <= 1 || tabel_grid.Row == 0)
            {
                return;
            }

            if (tabel_grid[tabel_grid.Row, tabel_grid.Col] == null)
            {
                return;
            }

            messagebox mb = null;

            if (prepod_list.SelectedIndex == 0)
            {
                mb = new messagebox(current_y, current_m, current_day,
                                    (int)prepod_set.Rows[current_row][0],
                                    tabel_grid[tabel_grid.Row, 0].ToString());
            }
            else
            {
                mb = new messagebox(current_y, current_m, current_day,
                                    (int)prepod_set.Rows[prepod_list.SelectedIndex - 1][0],
                                    tabel_grid[1, 0].ToString());
            }

            mb.ShowDialog();

            if (mb.changed)
            {
                fill_tabel();
            }

            mb.Dispose();
        }
Esempio n. 2
0
        private void tabel_grid_MouseDoubleClick(object sender, MouseEventArgs e)
        {
            if (tabel_grid.Col <= 1 || tabel_grid.Row == 0)
            {
                return;
            }

            if (tabel_grid[tabel_grid.Row, tabel_grid.Col] == null)
            {
                return;
            }

            messagebox mb = null;

            if (prepod_list.SelectedIndex == 0)
            {
                mb = new messagebox(current_y, current_m, current_day,
                                    (int)prepod_set.Rows[current_row][0],
                                    tabel_grid[tabel_grid.Row, 0].ToString());
            }
            else
            {
                mb = new messagebox(current_y, current_m, current_day,
                                    (int)prepod_set.Rows[prepod_list.SelectedIndex - 1][0],
                                    tabel_grid[1, 0].ToString());
            }

            mb.ShowDialog();

            if (mb.changed)
            {
                fill_tabel();
            }

            mb.Dispose();
        }