Exemplo n.º 1
0
        private void  m_mthShowTemplateContent(string[] strTitle, string[] strContent, string[] strXml)
        {
            bool blnReadOnly = true;

            if ((strTitle == null) || (strContent == null) || (strXml == null))
            {
                return;
            }

            //Create Controls
            while (strTitle.Length > m_arlControlGroup.Count)
            {
                clsControlGroup objCG;
                m_mthCreateControls(m_arlControlGroup.Count, out objCG);
                m_arlControlGroup.Add(objCG);
            }

            //
            m_pnlContent.Visible = false;
            m_pnlContent.SuspendLayout();
            m_pnlContent.Controls.Clear();

            int intTop = 0;

            for (int i = 0; i < strTitle.Length; i++)
            {
                if ((i >= strContent.Length) || (i >= strXml.Length))
                {
                    break;
                }

                clsControlGroup objCG = (clsControlGroup)(m_arlControlGroup[i]);

                m_pnlContent.Controls.Add(objCG.m_txtTitle);
                m_pnlContent.Controls.Add(objCG.m_txtContent);

                objCG.m_mthSetContent(c_intDefaultTextBoxWidth, strTitle[i], strContent[i], strXml[i], blnReadOnly);
                objCG.m_txtContent.m_mthSetNewText(strContent[i], strXml[i]);

                objCG.m_txtTitle.Location = new Point(0, intTop);
                intTop += objCG.m_txtTitle.Height + 1;

                objCG.m_txtContent.Location = new Point(0, intTop);
                intTop += objCG.m_txtContent.Height + 1;
            }
            m_pnlContent.ResumeLayout(true);
            m_pnlContent.Visible = true;
        }
Exemplo n.º 2
0
        private void m_mthCreateControls(int intIndex, out clsControlGroup ctlGroup)
        {
            System.Windows.Forms.TextBox txtTitle = new System.Windows.Forms.TextBox();
            ctlRichTextBox txtContent             = new ctlRichTextBox();

            // txtTitle
            txtTitle.BackColor   = System.Drawing.SystemColors.Info;
            txtTitle.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
//			txtTitle.Dock = System.Windows.Forms.DockStyle.Top;
//			txtTitle.Location = new System.Drawing.Point(0, 0);
            txtTitle.Size     = new System.Drawing.Size(296, 23);
            txtTitle.Name     = "textBox_" + intIndex.ToString();
            txtTitle.TabIndex = 30 + 5 * intIndex;
            txtTitle.Text     = "";
            //txtContent
            txtContent.BackColor   = System.Drawing.Color.FromArgb(((System.Byte)(225)), ((System.Byte)(225)), ((System.Byte)(192)));
            txtContent.BorderStyle = System.Windows.Forms.BorderStyle.None;
//			txtContent.Dock = System.Windows.Forms.DockStyle.Top;
            txtContent.ForeColor = System.Drawing.SystemColors.WindowText;
//			txtContent.Location = new System.Drawing.Point(0, 30);
            txtContent.m_BlnPartControl           = false;
            txtContent.m_BlnUnderLineDST          = false;
            txtContent.m_ClrDST                   = System.Drawing.Color.Red;
            txtContent.m_ClrOldPartInsertText     = System.Drawing.Color.Black;
            txtContent.m_IntCanModifyTime         = 6;
            txtContent.m_IntPartControlLength     = 0;
            txtContent.m_IntPartControlStartIndex = 0;
            txtContent.m_BlnCanModifyLast         = true;
            txtContent.m_StrUserID                = "";
            txtContent.m_StrUserName              = "";
            txtContent.Name = "txtContent_" + intIndex.ToString();
//			txtContent.Size = new System.Drawing.Size(296, 125);
            txtContent.TabIndex = 30 + 5 * intIndex + 1;
            txtContent.Text     = "";

            //
            txtContent.MouseDown += new System.Windows.Forms.MouseEventHandler(m_txtTemplate_MouseDown);
            txtTitle.MouseDown   += new System.Windows.Forms.MouseEventHandler(m_txtTemplate_MouseDown);

            //
            clsControlGroup objGroup = new clsControlGroup();

            objGroup.m_txtTitle   = txtTitle;
            objGroup.m_txtContent = txtContent;

            ctlGroup = objGroup;
        }