コード例 #1
0
        private void btnViewContent_Click(object sender, EventArgs e)
        {
            if (dataGridViewX1.SelectedRows.Count == 1)
            {
                MessageLogRecord record = (MessageLogRecord)dataGridViewX1.SelectedRows[0].Tag;

                LogViewForm view = new LogViewForm(record, "student");
                view.ShowDialog();
            }
            else
            {
                MsgBox.Show("請選擇一筆資料");
            }
        }
コード例 #2
0
 private void dataGridViewX1_CellMouseDoubleClick(object sender, DataGridViewCellMouseEventArgs e)
 {
     if (e.ColumnIndex > -1 && e.RowIndex > -1)
     {
         if (e.ColumnIndex <= 3)
         {
             MessageLogRecord record = (MessageLogRecord)dataGridViewX1.SelectedRows[0].Tag;
             LogViewForm      view   = new LogViewForm(record, "teacher");
             view.ShowDialog();
         }
         else
         {
             MessageLogRecord    record = (MessageLogRecord)dataGridViewX1.SelectedRows[0].Tag;
             LogTeacherCountForm view   = new LogTeacherCountForm(record);
             view.ShowDialog();
         }
     }
 }