示例#1
0
        private void DgMode_CellBeginEdit(object sender, DataGridViewCellCancelEventArgs e)
        {
            if (e.ColumnIndex == -1)
            {
                return;
            }
            if (e.RowIndex == -1)
            {
                return;
            }
            if (DgMode.RowCount == 0)
            {
                return;
            }
            if (e.ColumnIndex == 3)
            {
                DgMode.Controls.Add(txtScene);
                txtScene.Text = HDLPF.GetTimeFromString(DgMode[3, e.RowIndex].Value.ToString(), '.');

                Rectangle rect = DgMode.GetCellDisplayRectangle(3, e.RowIndex, true);
                txtScene.Size = rect.Size;
                txtScene.Top  = rect.Top;
                txtScene.Left = rect.Left;
                txtScene.Show();
                txtScene.Visible      = true;
                txtScene.TextChanged += new EventHandler(txtScene_TextChanged);
            }
            else
            {
                txtScene.Visible = false;
            }
        }
示例#2
0
 private void DgCurtain_CellBeginEdit(object sender, DataGridViewCellCancelEventArgs e)
 {
     txtSeries1.Visible = false;
     txtTimeMs.Visible  = false;
     if (mywdDeviceType == 706 || mywdDeviceType == 707 || mywdDeviceType == 713 || mywdDeviceType == 719)
     {
         if (e.ColumnIndex != 1 && e.ColumnIndex != 0 && e.ColumnIndex != 5)
         {
             lbRead.Controls.Add(txtTimeMs);
             txtTimeMs.Text = HDLPF.GetTimeFrmStringMs(lbRead[e.ColumnIndex, e.RowIndex].Value.ToString());
             txtTimeMs.Show();
             txtTimeMs.Visible = true;
             Rectangle rect = lbRead.GetCellDisplayRectangle(e.ColumnIndex, e.RowIndex, true);
             txtTimeMs.Size         = rect.Size;
             txtTimeMs.Top          = rect.Top;
             txtTimeMs.Left         = rect.Left;
             txtTimeMs.TextChanged += txtTimeMs_TextChanged;
         }
     }
     else
     {
         if (e.ColumnIndex != 1 && e.ColumnIndex != 0 && e.ColumnIndex != 5)
         {
             lbRead.Controls.Add(txtSeries1);
             txtSeries1.Text = HDLPF.GetTimeFromString(lbRead[e.ColumnIndex, e.RowIndex].Value.ToString(), ':');
             txtSeries1.Show();
             txtSeries1.Visible = true;
             Rectangle rect = lbRead.GetCellDisplayRectangle(e.ColumnIndex, e.RowIndex, true);
             txtSeries1.Size         = rect.Size;
             txtSeries1.Top          = rect.Top;
             txtSeries1.Left         = rect.Left;
             txtSeries1.TextChanged += new EventHandler(txtScene_TextChanged);
         }
     }
 }