private void ShowProblem(List <ProblemWithTypeName> ProblemList) { this.panelProblemGroup.Controls.Clear(); int hei = 0; foreach (ProblemWithTypeName problemWithTN in ProblemList) { OneProblemForm porblemForm = new OneProblemForm(problemWithTN, this.selProblem); porblemForm.TopLevel = false; porblemForm.Location = new Point(0, hei); this.panelProblemGroup.Controls.Add(porblemForm); porblemForm.Show(); hei += porblemForm.Height + 5; } if (hei == 0) { //MessageBox.Show("无内容"); } }
private void SelProblem(OneProblemForm oneProblemForm, ProblemWithTypeName problemWithTN, bool IsBtn) { //if (this.CurSelProblemWithTN != problemWithTN) //{ // this.CurSelProblemWithTN = problemWithTN; // this.tbProblemType.Text = this.CurSelProblemWithTN.TypeName; // this.rtbProblemOther.Text = this.CurSelProblemWithTN.Other; //} if (CurSelProblemForm != oneProblemForm) { if (CurSelProblemForm != null) { CurSelProblemForm.CancelFocus(); } CurSelProblemForm = oneProblemForm; CurSelProblemForm.SetFocus(); this.CurSelProblemWithTN = CurSelProblemForm.cuProblemWithTN; this.tbProblemType.Text = this.CurSelProblemWithTN.TypeName; this.rtbProblemOther.Text = this.CurSelProblemWithTN.Other; } if (IsBtn) { //MessageBox.Show("添加到试卷"); if (this.IKnowltAndProblemFormReq.InsertOneProblem(this.CurSelProblemWithTN) == 1) { if (this.varClosePaper == null) { this.varClosePaper = new ClosePaper(this.ClosePaper); } PaperForm.getInstance(this.varClosePaper).AddChild(new ProblemInPaper(this.CurSelProblemWithTN)); } } this.ShowAnswer(); }