private void CallSubView(int idx) { Point startPosition = Cursor.Position; startPosition.Y -= theSubView.Height / 2; startPosition.X -= theSubView.Width / 2; using (theSubView = new PMSubmit(4, Grid_PM[4, idx].Value.ToString(), Grid_PM[7, idx].Value.ToString())) { theSubView.startPosition = Cursor.Position; var result = theSubView.ShowDialog(); if (result == DialogResult.OK) { Grid_PM[4, idx].Value = theSubView.SelectedInstruction; AUpdateData(idx, 4, theSubView.SelectedInstruction); } } }
private void NewMicroOperation() { string newMicroInstruction = ""; string currentRadioButtonText = Convert.ToString(Grid_PM.CurrentCell.Value); string currentMicroInstruction = currentRadioButtonText.Split()[0]; using (theSubView = new PMSubmit(Convert.ToInt32(Grid_PM.CurrentCell.ColumnIndex), currentMicroInstruction, Grid_PM[7, Grid_PM.CurrentCell.RowIndex].Value.ToString())) { //theSubView.StartPosition = FormStartPosition.CenterScreen; theSubView.startPosition = Cursor.Position; var result = theSubView.ShowDialog(); if (result == DialogResult.OK) { newMicroInstruction = theSubView.SelectedInstruction; if (currentMicroInstruction == "SHT" && newMicroInstruction != "SHT") { Grid_PM[4, Grid_PM.CurrentCell.RowIndex].Value = ""; AUpdateData(Grid_PM.CurrentCell.RowIndex, 4, ""); } } else { newMicroInstruction = currentMicroInstruction; } } NewMicroInstruction(newMicroInstruction, currentMicroInstruction); if (newMicroInstruction == "SHT") { using (theSubView = new PMSubmit(4, Grid_PM[4, idxRow].Value.ToString(), Grid_PM[7, idxRow].Value.ToString())) { theSubView.startPosition = Cursor.Position; var result = theSubView.ShowDialog(); if (result == DialogResult.OK) { newMicroInstruction = theSubView.SelectedInstruction; } else { newMicroInstruction = currentMicroInstruction; } Grid_PM[4, idxRow].Value = newMicroInstruction; AUpdateData(idxRow, 4, newMicroInstruction); } } }