private void simpleButtonAdd_Click(object sender, EventArgs e) { WaitDialog.CreateWaitDialog("Loading components..."); popupDialog = new PopupDialog(); Padding pads = popupDialog.Padding; pads.Left = 5; popupDialog.WindowState = FormWindowState.Maximized; popupDialog.StartPosition = FormStartPosition.CenterScreen; popupDialog.Text = "Add Question"; ucNewQuestion1 = new Modules.NewQuestions(); ucNewQuestion1.Dock = DockStyle.Fill; ucNewQuestion1.lblHeader.Text = "Add Question"; popupDialog.Controls.Add(ucNewQuestion1); popupDialog.ClientSize = new Size(ucNewQuestion1.Width + 10, ucNewQuestion1.Height + 10); popupDialog.ShowDialog(this.ParentForm); WaitDialog.CloseWaitDialog(); }
private void simpleButtonEdit_Click(object sender, EventArgs e) { WaitDialog.CreateWaitDialog("Loading components..."); popupDialog = new PopupDialog(); Padding pads = popupDialog.Padding; pads.Left = 5; popupDialog.WindowState = FormWindowState.Maximized; popupDialog.StartPosition = FormStartPosition.CenterScreen; popupDialog.Text = "Edit Question"; GridView view = gridViewQuestion; if (view != null || view.SelectedRowsCount > 0) { var ctqt = view.GetRow(view.GetSelectedRows()[0]) as CTQuestionTags; ucNewQuestion1 = new Modules.NewQuestions(ctqt.question_id); } ucNewQuestion1.Dock = DockStyle.Fill; ucNewQuestion1.lblHeader.Text = "Edit Question"; popupDialog.Controls.Add(ucNewQuestion1); popupDialog.ClientSize = new Size(ucNewQuestion1.Width + 10, ucNewQuestion1.Height + 10); popupDialog.ShowDialog(this.ParentForm); popupDialog.FormClosing += new FormClosingEventHandler(popupDialog_FormClosing); WaitDialog.CloseWaitDialog(); }
private void simpleButtonAddQuestion_Click(object sender, EventArgs e) { dialog = new PopupDialog(); dialog.FormBorderStyle = FormBorderStyle.FixedSingle; dialog.MinimizeBox = false; dialog.MaximizeBox = false; dialog.StartPosition = FormStartPosition.CenterScreen; dialog.Text = "Add New Question"; dialog.Controls.Add(ucAddQuestion); dialog.ClientSize = new Size(oQuestionSize.Width + 10, oQuestionSize.Height + 10); dialog.ShowDialog(this.ParentForm); }
private void simpleButtonAssignAnswerForm_Click(object sender, EventArgs e) { Cursor currentCursor = Cursor.Current; Cursor.Current = Cursors.WaitCursor; GridView view = gridViewDialog; view.GridControl.Focus(); int index = view.FocusedRowHandle; if (index < 0) return; var row = view.GetDataRow(index); if (row != null) { popupDialog = new PopupDialog(); popupDialog.FormBorderStyle = FormBorderStyle.FixedSingle; popupDialog.MinimizeBox = false; popupDialog.MaximizeBox = false; popupDialog.StartPosition = FormStartPosition.CenterScreen; int questionid = Convert.ToInt32(row["question_id"]); var ucAddAnswerform = new AddAnswerForm(questionid, gridViewDialog); Size oSize = ucAddAnswerform.Size; ucAddAnswerform.Dock = DockStyle.Fill; popupDialog.Text = "Select Answer Form"; popupDialog.Controls.Add(ucAddAnswerform); popupDialog.ClientSize = new Size(oSize.Width + 10, oSize.Height + 10); popupDialog.ShowDialog(this.ParentForm); } Cursor.Current = currentCursor; }