private void tsm3_Click(object sender, EventArgs e) { try { DataGridView dgv = new DataGridView(); if (tabSim.SelectedTab.Name == "tabDev") { dgv = this.dgOnline; } if (dgv.SelectedRows.Count != 1) { return; } Cursor.Current = Cursors.WaitCursor; CsConst.MyTmpName = new List <string>(); int wdDeviceType = CsConst.myOnlines[currentSelectDeviceDindex].DeviceType; frmModifAddress frmNew = new frmModifAddress(currentSelectDeviceSubnetId, currentSelectDeviceDeviceId, wdDeviceType); if (frmNew.ShowDialog() == DialogResult.OK) { UpdateAddressAfterModify(); } Cursor.Current = Cursors.Default; } catch { } }
private void dgvResult_CellMouseDoubleClick(object sender, DataGridViewCellMouseEventArgs e) { try { if ((sender as DataGridView).SelectedCells == null) { return; } if (e.RowIndex < 0) { return; } Cursor.Current = Cursors.WaitCursor; int rowIndex = dgvResult.SelectedRows[0].Index; if (e.ColumnIndex == 1 || e.ColumnIndex == 2) { Cursor.Current = Cursors.WaitCursor; currentSelectDeviceSubnetId = Byte.Parse(dgvResult.SelectedCells[1].Value.ToString()); currentSelectDeviceDeviceId = Byte.Parse(dgvResult.SelectedCells[2].Value.ToString()); int wdDeviceType = Int32.Parse(dgvResult.SelectedCells[6].Value.ToString()); CsConst.MyTmpName = new List <string>(); frmModifAddress frmNew = new frmModifAddress(currentSelectDeviceSubnetId, currentSelectDeviceDeviceId, wdDeviceType); if (frmNew.ShowDialog() == DialogResult.OK) { dgvResult.SelectedCells[1].Value = CsConst.MyTmpName[0]; dgvResult.SelectedCells[2].Value = CsConst.MyTmpName[1]; } } } catch { } }
private void ADV3_Click(object sender, EventArgs e) { try { CsConst.MyTmpName = new List <string>(); frmModifAddress frmNew = new frmModifAddress(); if (frmNew.ShowDialog() == DialogResult.OK) { UpdateAddressAfterModify(); } } catch { } }