void FncSetInnerCanvas() { //cnvPaint.Height = 280; //cnvPaint.Width = 700; Label lblHeader = new Label(); lblHeader.Content = objQueCollection[CurrentQueCount].QuestionName; lblHeader.SizeChanged += new SizeChangedEventHandler(lblQuestion_SizeChanged); lblHeader.FontSize = 19; cnvPaint.Children.Add(lblHeader); Label lblQuestion = new Label(); lblQuestion.Content = objQueCollection[CurrentQueCount].QuestionText; lblQuestion.FontSize = 17; lblQuestion.SizeChanged += new SizeChangedEventHandler(lblQuestion_SizeChanged); Canvas.SetTop(lblQuestion, 60); cnvPaint.Children.Add(lblQuestion); ClsOptionCollection objOptCollection = ClsOptionCollection.GetAll(objQueCollection[CurrentQueCount].ID); varType = objQueCollection[CurrentQueCount].Category; if (varType == "CheckBox") { for (int i = 0; i < objOptCollection.Count; i++) { CheckBox chk = new CheckBox(); chk.Content = objOptCollection[i].Options; chk.Tag = objOptCollection[i].ActionQueueID.ToString() + "," + objOptCollection[i].ID.ToString(); chk.SizeChanged += new SizeChangedEventHandler(lblQuestion_SizeChanged); chk.Height = 18; chk.FontSize = 14; Canvas.SetLeft(chk, 25); varTop = 120 + (30 * i); Canvas.SetTop(chk, varTop); cnvPaint.Children.Add(chk); } } else if (varType == "RadioButton") { for (int i = 0; i < objOptCollection.Count; i++) { RadioButton chk = new RadioButton(); chk.Content = objOptCollection[i].Options; chk.Tag = objOptCollection[i].ActionQueueID.ToString() + "," + objOptCollection[i].ID.ToString(); chk.SizeChanged += new SizeChangedEventHandler(lblQuestion_SizeChanged); chk.Height = 18; chk.FontSize = 14; Canvas.SetLeft(chk, 25); varTop = 120 + (30 * i); Canvas.SetTop(chk, varTop); cnvPaint.Children.Add(chk); } } cnvPaint.Height = varTop + 50; sv.ScrollToTop(); }
void FncSetInnerCanvas() { try { //cnvPaint.Height = 280; //cnvPaint.Width = 700; Label lblHeader = new Label(); lblHeader.Content = objQueCollection[CurrentQueCount].QuestionName; lblHeader.SizeChanged += new SizeChangedEventHandler(lblQuestion_SizeChanged); lblHeader.FontSize = 19; cnvPaint.Children.Add(lblHeader); Label lblQuestion = new Label(); lblQuestion.Content = objQueCollection[CurrentQueCount].QuestionText; lblQuestion.FontSize = 17; lblQuestion.SizeChanged += new SizeChangedEventHandler(lblQuestion_SizeChanged); Canvas.SetTop(lblQuestion, 60); cnvPaint.Children.Add(lblQuestion); ClsOptionCollection objOptCollection = ClsOptionCollection.GetAll(objQueCollection[CurrentQueCount].ID); varType = objQueCollection[CurrentQueCount].Category; if (varType == "CheckBox") { for (int i = 0; i < objOptCollection.Count; i++) { CheckBox chk = new CheckBox(); chk.Content = objOptCollection[i].Options; chk.Tag = objOptCollection[i].ActionQueueID.ToString() + "," + objOptCollection[i].ID.ToString(); chk.SizeChanged += new SizeChangedEventHandler(lblQuestion_SizeChanged); chk.Height = 18; chk.FontSize = 14; Canvas.SetLeft(chk, 25); varTop = 120 + (30 * i); Canvas.SetTop(chk, varTop); cnvPaint.Children.Add(chk); } } else if (varType == "RadioButton") { for (int i = 0; i < objOptCollection.Count; i++) { RadioButton chk = new RadioButton(); chk.Content = objOptCollection[i].Options; chk.Tag = objOptCollection[i].ActionQueueID.ToString() + "," + objOptCollection[i].ID.ToString(); chk.SizeChanged += new SizeChangedEventHandler(lblQuestion_SizeChanged); chk.Height = 18; chk.FontSize = 14; Canvas.SetLeft(chk, 25); varTop = 120 + (30 * i); Canvas.SetTop(chk, varTop); cnvPaint.Children.Add(chk); } } cnvPaint.Height = varTop + 50; sv.ScrollToTop(); } catch (Exception exp) { exp.Data.Add("My Key", "FncSetInnerCanvas()--:--CtlDynamicScript.xaml.cs--:--" + exp.Message + " :--:--"); //ClsException.LogError(ex); //ClsException.WriteToErrorLogFile(ex); System.Text.StringBuilder sb = new StringBuilder(); sb.AppendLine(exp.Message); sb.AppendLine(); sb.AppendLine("StackTrace : " + exp.StackTrace); sb.AppendLine(); sb.AppendLine("Location : " + exp.Data["My Key"].ToString()); sb.AppendLine(); sb1 = CreateTressInfo(); sb.Append(sb1.ToString()); VMuktiAPI.ClsLogging.WriteToTresslog(sb); } }