예제 #1
0
        private void Doc_PrintPage(object sender, PrintPageEventArgs e)
        {
            //Print image
            // Bitmap bm = new Bitmap(picBarCode.Image);

            e.Graphics.InterpolationMode  = InterpolationMode.HighQualityBicubic;
            e.Graphics.PixelOffsetMode    = PixelOffsetMode.Half;
            e.Graphics.SmoothingMode      = SmoothingMode.AntiAlias;
            e.Graphics.CompositingQuality = CompositingQuality.GammaCorrected;
            e.Graphics.CompositingMode    = CompositingMode.SourceCopy;

            //e.Graphics.DrawImage(bm, 0, 0);
            //bm.Dispose();

            using (Graphics g = e.Graphics)
            {
                string strBarCodeSettingValue = GetBarCodeSettings();
                if (strBarCodeSettingValue != null)
                {
                    string[] strfiles = strBarCodeSettingValue.Split('\n');

                    if (strfiles.Length > 0)
                    {
                        string ProductID = _PrintRowData.Cells["ColProductID"].Value.ToString();
                        //obj.Controls.Clear();
                        //    obj.Refresh();
                        AddNewPage();

                        if (strfiles.Length > 0)
                        {
                            for (int i = 0; i < strfiles.Length; i++)
                            {
                                string[] strInfo = strfiles[i].Split('@');

                                if (i == 0)
                                {
                                    obj.BackColor = Color.FromArgb(Convert.ToInt32(strInfo[0]));
                                    obj.Size      = new Size(Convert.ToInt32(strInfo[1]), Convert.ToInt32(strInfo[2]));
                                }
                                else
                                { //Type-IsBold-Family-argb(int)-fsize(float)-w-h-x-y-text-backColor(int)-RecBorderStyle-borderStyle-borderColor
                                    if (strInfo[0] == "Label")
                                    {
                                        Label objLable = new Label();
                                        if (strInfo[1] == "True")
                                        {
                                            objLable.Font = new Font(strInfo[2], float.Parse(strInfo[4]), FontStyle.Bold);
                                        }
                                        else
                                        {
                                            objLable.Font = new Font(strInfo[2], float.Parse(strInfo[4]), FontStyle.Regular);
                                        }

                                        objLable.ForeColor = Color.FromArgb(Convert.ToInt32(strInfo[3]));
                                        objLable.Size      = new Size(Convert.ToInt32(strInfo[5]), Convert.ToInt32(strInfo[6]));
                                        objLable.Location  = new Point(Convert.ToInt32(strInfo[7]), Convert.ToInt32(strInfo[8]));
                                        objLable.Text      = strInfo[9];

                                        objLable.BackColor = Color.FromArgb(Convert.ToInt32(strInfo[10]));
                                        objLable.Tag       = strInfo[14];

                                        SetBarCodeValues(objLable, _PrintRowData);

                                        obj.Controls.Add(objLable);
                                        obj.Refresh();

                                        string caption3 = string.Format(objLable.Text);
                                        g.DrawString(caption3, objLable.Font, System.Drawing.Brushes.Black, objLable.Location.X, objLable.Location.Y);
                                    }
                                    else if (strInfo[0] == "VerticalLabel")
                                    {
                                        VerticalLabel objLable = new VerticalLabel();
                                        if (strInfo[1] == "True")
                                        {
                                            objLable.Font = new Font(strInfo[2], float.Parse(strInfo[4]), FontStyle.Bold);
                                        }
                                        else
                                        {
                                            objLable.Font = new Font(strInfo[2], float.Parse(strInfo[4]), FontStyle.Regular);
                                        }

                                        objLable.ForeColor = Color.FromArgb(Convert.ToInt32(strInfo[3]));
                                        objLable.Size      = new Size(Convert.ToInt32(strInfo[5]), Convert.ToInt32(strInfo[6]));
                                        objLable.Location  = new Point(Convert.ToInt32(strInfo[7]), Convert.ToInt32(strInfo[8]));
                                        objLable.Text      = strInfo[9];

                                        objLable.BackColor = Color.FromArgb(Convert.ToInt32(strInfo[10]));
                                        objLable.Tag       = strInfo[14];

                                        SetBarCodeValues(objLable, _PrintRowData);

                                        objLable.MouseLeave += new EventHandler(obj.control_MouseLeave);
                                        obj.Controls.Add(objLable);
                                        obj.Refresh();

                                        string captionText   = objLable.Text;
                                        Size   preferredSize = g.MeasureString(objLable.Text, objLable.Font).ToSize();

                                        // change this value
                                        int padding = 20;

                                        DrawRotatedTextAt(g, -90, captionText,
                                                          objLable.Location.X, objLable.Location.Y + preferredSize.Width + padding, objLable.Font, Brushes.Black);
                                    }
                                    else if (strInfo[0] == "PictureBox")
                                    {
                                        PictureBox objPicBox = new PictureBox();

                                        objPicBox.Size        = new Size(Convert.ToInt32(strInfo[5]), Convert.ToInt32(strInfo[6]));
                                        objPicBox.Location    = new Point(Convert.ToInt32(strInfo[7]), Convert.ToInt32(strInfo[8]));
                                        objPicBox.BorderStyle = BorderStyle.FixedSingle;

                                        objPicBox.Image       = Barcode.clsBarCodeUtility.GenerateBarCode(_Current_BarCodeNumber);
                                        objPicBox.SizeMode    = PictureBoxSizeMode.StretchImage;
                                        objPicBox.MouseLeave += new EventHandler(obj.control_MouseLeave);
                                        obj.Controls.Add(objPicBox);

                                        g.DrawImage(objPicBox.Image, objPicBox.Location.X, objPicBox.Location.Y, objPicBox.Width, objPicBox.Height);
                                    }
                                    else if (strInfo[0] == "uRectangle")
                                    {
                                        uRectangle objRec = new uRectangle();
                                        objRec.Size     = new Size(Convert.ToInt32(strInfo[5]), Convert.ToInt32(strInfo[6]));
                                        objRec.Location = new Point(Convert.ToInt32(strInfo[7]), Convert.ToInt32(strInfo[8]));

                                        objRec.BackColor = Color.FromArgb(Convert.ToInt32(strInfo[10]));

                                        switch (strInfo[11].Trim())
                                        {
                                        case "None":
                                            objRec.RectangleBorderStyle = ButtonBorderStyle.None;
                                            break;

                                        case "Dotted":
                                            objRec.RectangleBorderStyle = ButtonBorderStyle.Dotted;
                                            break;

                                        case "Dashed":
                                            objRec.RectangleBorderStyle = ButtonBorderStyle.Dashed;
                                            break;

                                        case "Solid":
                                            objRec.RectangleBorderStyle = ButtonBorderStyle.Solid;
                                            break;

                                        case "Inset":
                                            objRec.RectangleBorderStyle = ButtonBorderStyle.Inset;
                                            break;

                                        case "Outset":
                                            objRec.RectangleBorderStyle = ButtonBorderStyle.Outset;
                                            break;
                                        }

                                        switch (strInfo[12].Trim())
                                        {
                                        case "None":
                                            objRec.BorderStyle = BorderStyle.Fixed3D;
                                            break;

                                        case "FixedSingle":
                                            objRec.BorderStyle = BorderStyle.FixedSingle;
                                            break;

                                        case "Fixed3D":
                                            objRec.BorderStyle = BorderStyle.Fixed3D;
                                            break;
                                        }
                                        objRec.BorderColor = Color.FromArgb(Convert.ToInt32(strInfo[13].Trim()));

                                        objRec.MouseEnter  += new EventHandler(obj.control_MouseEnter);
                                        objRec.MouseLeave  += new EventHandler(obj.control_MouseLeave);
                                        objRec.MouseDown   += new MouseEventHandler(obj.control_MouseDown);
                                        objRec.MouseMove   += new MouseEventHandler(obj.control_MouseMove);
                                        objRec.MouseUp     += new MouseEventHandler(obj.control_MouseUp);
                                        objRec.Click       += obj.ctrl_Click;
                                        objRec.DoubleClick += obj.ctrl_DoubleClick;

                                        objRec.Click += new EventHandler(obj.ctrl_Click);

                                        objRec.MouseLeave += new EventHandler(obj.control_MouseLeave);
                                        obj.Controls.Add(objRec);
                                        obj.Refresh();
                                    }
                                    else if (strInfo[0] == "Line")
                                    {
                                        Line objLable = new Line();
                                        if (strInfo[1] == "True")
                                        {
                                            objLable.Font = new Font(strInfo[2], float.Parse(strInfo[4]), FontStyle.Bold);
                                        }
                                        else
                                        {
                                            objLable.Font = new Font(strInfo[2], float.Parse(strInfo[4]), FontStyle.Regular);
                                        }

                                        objLable.ForeColor = Color.FromArgb(Convert.ToInt32(strInfo[3]));
                                        objLable.Size      = new Size(Convert.ToInt32(strInfo[5]), Convert.ToInt32(strInfo[6]));
                                        objLable.Location  = new Point(Convert.ToInt32(strInfo[7]), Convert.ToInt32(strInfo[8]));
                                        objLable.Text      = strInfo[9];

                                        objLable.BackColor = Color.FromArgb(Convert.ToInt32(strInfo[10]));
                                        obj.Controls.Add(objLable);
                                        obj.Refresh();
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
예제 #2
0
        private void LoadTemplate(bool IsFromFile)
        {
            string strBarCodeSettingValue = "";

            if (IsFromFile)
            {
                OpenFileDialog openFileDialog = new OpenFileDialog();
                if (openFileDialog.ShowDialog() == DialogResult.OK)
                {
                    strBarCodeSettingValue = File.ReadAllText(openFileDialog.FileName);
                }
            }
            else
            {
                strBarCodeSettingValue = GetBarCodeSettings();
            }

            if (strBarCodeSettingValue != null)
            {
                string[] strfiles = strBarCodeSettingValue.Split('\n');

                if (strfiles.Length > 0)
                {
                    this.Controls.Remove(obj);
                    this.Invalidate();

                    //obj.Controls.Clear();
                    //    obj.Refresh();
                    AddNewPage();

                    if (strfiles.Length > 0)
                    {
                        for (int i = 0; i < strfiles.Length; i++)
                        {
                            string[] strInfo = strfiles[i].Split('@');

                            if (i == 0)
                            {
                                obj.BackColor = Color.FromArgb(Convert.ToInt32(strInfo[0]));
                                obj.Size      = new Size(Convert.ToInt32(strInfo[1]), Convert.ToInt32(strInfo[2]));
                            }
                            else
                            { //Type-IsBold-Family-argb(int)-fsize(float)-w-h-x-y-text-backColor(int)-RecBorderStyle-borderStyle-borderColor
                                if (strInfo[0] == "Label")
                                {
                                    Label objLable = new Label();
                                    if (strInfo[1] == "True")
                                    {
                                        objLable.Font = new Font(strInfo[2], float.Parse(strInfo[4]), FontStyle.Bold);
                                    }
                                    else
                                    {
                                        objLable.Font = new Font(strInfo[2], float.Parse(strInfo[4]), FontStyle.Regular);
                                    }

                                    objLable.ForeColor = Color.FromArgb(Convert.ToInt32(strInfo[3]));
                                    objLable.Size      = new Size(Convert.ToInt32(strInfo[5]), Convert.ToInt32(strInfo[6]));
                                    objLable.Location  = new Point(Convert.ToInt32(strInfo[7]), Convert.ToInt32(strInfo[8]));
                                    objLable.Text      = strInfo[9];

                                    objLable.BackColor = Color.FromArgb(Convert.ToInt32(strInfo[10]));
                                    objLable.Tag       = strInfo[14];

                                    objLable.MouseEnter      += new EventHandler(obj.control_MouseEnter);
                                    objLable.MouseLeave      += new EventHandler(obj.control_MouseLeave);
                                    objLable.MouseDown       += new MouseEventHandler(obj.control_MouseDown);
                                    objLable.MouseMove       += new MouseEventHandler(obj.control_MouseMove);
                                    objLable.MouseUp         += new MouseEventHandler(obj.control_MouseUp);
                                    objLable.Click           += obj.ctrl_Click;
                                    objLable.DoubleClick     += obj.ctrl_DoubleClick;
                                    objLable.ContextMenuStrip = contextMenuStrip1;
                                    objLable.Click           += new EventHandler(obj.ctrl_Click);

                                    objLable.MouseLeave += new EventHandler(obj.control_MouseLeave);
                                    obj.Controls.Add(objLable);
                                }
                                else if (strInfo[0] == "VerticalLabel")
                                {
                                    VerticalLabel objLable = new VerticalLabel();
                                    if (strInfo[1] == "True")
                                    {
                                        objLable.Font = new Font(strInfo[2], float.Parse(strInfo[4]), FontStyle.Bold);
                                    }
                                    else
                                    {
                                        objLable.Font = new Font(strInfo[2], float.Parse(strInfo[4]), FontStyle.Regular);
                                    }

                                    objLable.ForeColor = Color.FromArgb(Convert.ToInt32(strInfo[3]));
                                    objLable.Size      = new Size(Convert.ToInt32(strInfo[5]), Convert.ToInt32(strInfo[6]));
                                    objLable.Location  = new Point(Convert.ToInt32(strInfo[7]), Convert.ToInt32(strInfo[8]));
                                    objLable.Text      = strInfo[9];

                                    objLable.BackColor = Color.FromArgb(Convert.ToInt32(strInfo[10]));
                                    objLable.Tag       = strInfo[14];

                                    objLable.MouseEnter      += new EventHandler(obj.control_MouseEnter);
                                    objLable.MouseLeave      += new EventHandler(obj.control_MouseLeave);
                                    objLable.MouseDown       += new MouseEventHandler(obj.control_MouseDown);
                                    objLable.MouseMove       += new MouseEventHandler(obj.control_MouseMove);
                                    objLable.MouseUp         += new MouseEventHandler(obj.control_MouseUp);
                                    objLable.Click           += obj.ctrl_Click;
                                    objLable.DoubleClick     += obj.ctrl_DoubleClick;
                                    objLable.ContextMenuStrip = contextMenuStrip1;
                                    objLable.Click           += new EventHandler(obj.ctrl_Click);

                                    objLable.MouseLeave += new EventHandler(obj.control_MouseLeave);
                                    obj.Controls.Add(objLable);
                                }
                                else if (strInfo[0] == "PictureBox")
                                {
                                    PictureBox objPicBox = new PictureBox();

                                    objPicBox.Size             = new Size(Convert.ToInt32(strInfo[5]), Convert.ToInt32(strInfo[6]));
                                    objPicBox.Location         = new Point(Convert.ToInt32(strInfo[7]), Convert.ToInt32(strInfo[8]));
                                    objPicBox.BorderStyle      = BorderStyle.FixedSingle;
                                    objPicBox.MouseEnter      += new EventHandler(obj.control_MouseEnter);
                                    objPicBox.MouseLeave      += new EventHandler(obj.control_MouseLeave);
                                    objPicBox.MouseDown       += new MouseEventHandler(obj.control_MouseDown);
                                    objPicBox.MouseMove       += new MouseEventHandler(obj.control_MouseMove);
                                    objPicBox.MouseUp         += new MouseEventHandler(obj.control_MouseUp);
                                    objPicBox.Click           += obj.ctrl_Click;
                                    objPicBox.DoubleClick     += obj.ctrl_DoubleClick;
                                    objPicBox.ContextMenuStrip = contextMenuStrip1;
                                    objPicBox.Click           += new EventHandler(obj.ctrl_Click);
                                    objPicBox.Image            = IMS.Properties.Resources.barCode;
                                    objPicBox.SizeMode         = PictureBoxSizeMode.StretchImage;
                                    objPicBox.MouseLeave      += new EventHandler(obj.control_MouseLeave);
                                    obj.Controls.Add(objPicBox);
                                }
                                else if (strInfo[0] == "uRectangle")
                                {
                                    uRectangle objRec = new uRectangle();
                                    objRec.Size     = new Size(Convert.ToInt32(strInfo[5]), Convert.ToInt32(strInfo[6]));
                                    objRec.Location = new Point(Convert.ToInt32(strInfo[7]), Convert.ToInt32(strInfo[8]));

                                    objRec.BackColor = Color.FromArgb(Convert.ToInt32(strInfo[10]));

                                    switch (strInfo[11].Trim())
                                    {
                                    case "None":
                                        objRec.RectangleBorderStyle = ButtonBorderStyle.None;
                                        break;

                                    case "Dotted":
                                        objRec.RectangleBorderStyle = ButtonBorderStyle.Dotted;
                                        break;

                                    case "Dashed":
                                        objRec.RectangleBorderStyle = ButtonBorderStyle.Dashed;
                                        break;

                                    case "Solid":
                                        objRec.RectangleBorderStyle = ButtonBorderStyle.Solid;
                                        break;

                                    case "Inset":
                                        objRec.RectangleBorderStyle = ButtonBorderStyle.Inset;
                                        break;

                                    case "Outset":
                                        objRec.RectangleBorderStyle = ButtonBorderStyle.Outset;
                                        break;
                                    }

                                    switch (strInfo[12].Trim())
                                    {
                                    case "None":
                                        objRec.BorderStyle = BorderStyle.Fixed3D;
                                        break;

                                    case "FixedSingle":
                                        objRec.BorderStyle = BorderStyle.FixedSingle;
                                        break;

                                    case "Fixed3D":
                                        objRec.BorderStyle = BorderStyle.Fixed3D;
                                        break;
                                    }
                                    objRec.BorderColor = Color.FromArgb(Convert.ToInt32(strInfo[13].Trim()));

                                    objRec.MouseEnter      += new EventHandler(obj.control_MouseEnter);
                                    objRec.MouseLeave      += new EventHandler(obj.control_MouseLeave);
                                    objRec.MouseDown       += new MouseEventHandler(obj.control_MouseDown);
                                    objRec.MouseMove       += new MouseEventHandler(obj.control_MouseMove);
                                    objRec.MouseUp         += new MouseEventHandler(obj.control_MouseUp);
                                    objRec.Click           += obj.ctrl_Click;
                                    objRec.DoubleClick     += obj.ctrl_DoubleClick;
                                    objRec.ContextMenuStrip = contextMenuStrip1;
                                    objRec.Click           += new EventHandler(obj.ctrl_Click);

                                    objRec.MouseLeave += new EventHandler(obj.control_MouseLeave);
                                    obj.Controls.Add(objRec);
                                }
                                else if (strInfo[0] == "Line")
                                {
                                    Line objLable = new Line();
                                    if (strInfo[1] == "True")
                                    {
                                        objLable.Font = new Font(strInfo[2], float.Parse(strInfo[4]), FontStyle.Bold);
                                    }
                                    else
                                    {
                                        objLable.Font = new Font(strInfo[2], float.Parse(strInfo[4]), FontStyle.Regular);
                                    }

                                    objLable.ForeColor = Color.FromArgb(Convert.ToInt32(strInfo[3]));
                                    objLable.Size      = new Size(Convert.ToInt32(strInfo[5]), Convert.ToInt32(strInfo[6]));
                                    objLable.Location  = new Point(Convert.ToInt32(strInfo[7]), Convert.ToInt32(strInfo[8]));
                                    objLable.Text      = strInfo[9];

                                    objLable.BackColor = Color.FromArgb(Convert.ToInt32(strInfo[10]));

                                    objLable.MouseEnter      += new EventHandler(obj.control_MouseEnter);
                                    objLable.MouseLeave      += new EventHandler(obj.control_MouseLeave);
                                    objLable.MouseDown       += new MouseEventHandler(obj.control_MouseDown);
                                    objLable.MouseMove       += new MouseEventHandler(obj.control_MouseMove);
                                    objLable.MouseUp         += new MouseEventHandler(obj.control_MouseUp);
                                    objLable.Click           += obj.ctrl_Click;
                                    objLable.DoubleClick     += obj.ctrl_DoubleClick;
                                    objLable.ContextMenuStrip = contextMenuStrip1;
                                    objLable.Click           += new EventHandler(obj.ctrl_Click);

                                    objLable.MouseLeave += new EventHandler(obj.control_MouseLeave);
                                    obj.Controls.Add(objLable);
                                }
                            }
                        }
                        this.Focus();
                        this.Activate();

                        clsUtility.ShowInfoMessage("Template Loaded Successfully.", "Designer Tool");
                    }
                }
            }
        }
예제 #3
0
        private void LoadTemplate(DataGridViewRow _Row)
        {
            string strBarCodeSettingValue = GetBarCodeSettings();

            if (strBarCodeSettingValue != null)
            {
                string[] strfiles = strBarCodeSettingValue.Split('\n');

                if (strfiles.Length > 0)
                {
                    string ProductID = _Row.Cells["ColProductID"].Value.ToString();
                    //obj.Controls.Clear();
                    //    obj.Refresh();
                    AddNewPage();

                    if (strfiles.Length > 0)
                    {
                        for (int i = 0; i < strfiles.Length; i++)
                        {
                            string[] strInfo = strfiles[i].Split('@');

                            if (i == 0)
                            {
                                obj.BackColor = Color.FromArgb(Convert.ToInt32(strInfo[0]));
                                obj.Size      = new Size(Convert.ToInt32(strInfo[1]), Convert.ToInt32(strInfo[2]));
                            }
                            else
                            { //Type-IsBold-Family-argb(int)-fsize(float)-w-h-x-y-text-backColor(int)-RecBorderStyle-borderStyle-borderColor
                                if (strInfo[0] == "Label")
                                {
                                    Label objLable = new Label();
                                    if (strInfo[1] == "True")
                                    {
                                        objLable.Font = new Font(strInfo[2], float.Parse(strInfo[4]), FontStyle.Bold);
                                    }
                                    else
                                    {
                                        objLable.Font = new Font(strInfo[2], float.Parse(strInfo[4]), FontStyle.Regular);
                                    }

                                    objLable.ForeColor = Color.FromArgb(Convert.ToInt32(strInfo[3]));
                                    objLable.Size      = new Size(Convert.ToInt32(strInfo[5]), Convert.ToInt32(strInfo[6]));
                                    objLable.Location  = new Point(Convert.ToInt32(strInfo[7]), Convert.ToInt32(strInfo[8]));
                                    objLable.Text      = strInfo[9];

                                    objLable.BackColor = Color.FromArgb(Convert.ToInt32(strInfo[10]));
                                    objLable.Tag       = strInfo[14];

                                    SetBarCodeValues(objLable, _Row);

                                    obj.Controls.Add(objLable);
                                    obj.Refresh();
                                }
                                else if (strInfo[0] == "VerticalLabel")
                                {
                                    VerticalLabel objLable = new VerticalLabel();
                                    if (strInfo[1] == "True")
                                    {
                                        objLable.Font = new Font(strInfo[2], float.Parse(strInfo[4]), FontStyle.Bold);
                                    }
                                    else
                                    {
                                        objLable.Font = new Font(strInfo[2], float.Parse(strInfo[4]), FontStyle.Regular);
                                    }

                                    objLable.ForeColor = Color.FromArgb(Convert.ToInt32(strInfo[3]));
                                    objLable.Size      = new Size(Convert.ToInt32(strInfo[5]), Convert.ToInt32(strInfo[6]));
                                    objLable.Location  = new Point(Convert.ToInt32(strInfo[7]), Convert.ToInt32(strInfo[8]));
                                    objLable.Text      = strInfo[9];

                                    objLable.BackColor = Color.FromArgb(Convert.ToInt32(strInfo[10]));
                                    objLable.Tag       = strInfo[14];

                                    SetBarCodeValues(objLable, _Row);

                                    objLable.MouseLeave += new EventHandler(obj.control_MouseLeave);
                                    obj.Controls.Add(objLable);
                                    obj.Refresh();
                                }
                                else if (strInfo[0] == "PictureBox")
                                {
                                    PictureBox objPicBox = new PictureBox();

                                    objPicBox.Size        = new Size(Convert.ToInt32(strInfo[5]), Convert.ToInt32(strInfo[6]));
                                    objPicBox.Location    = new Point(Convert.ToInt32(strInfo[7]), Convert.ToInt32(strInfo[8]));
                                    objPicBox.BorderStyle = BorderStyle.FixedSingle;

                                    string barValue = "Product_" + ProductID;

                                    objPicBox.Image       = Barcode.clsBarCodeUtility.GenerateBarCode(_Current_BarCodeNumber);
                                    objPicBox.SizeMode    = PictureBoxSizeMode.StretchImage;
                                    objPicBox.MouseLeave += new EventHandler(obj.control_MouseLeave);
                                    obj.Controls.Add(objPicBox);
                                }
                                else if (strInfo[0] == "uRectangle")
                                {
                                    uRectangle objRec = new uRectangle();
                                    objRec.Size     = new Size(Convert.ToInt32(strInfo[5]), Convert.ToInt32(strInfo[6]));
                                    objRec.Location = new Point(Convert.ToInt32(strInfo[7]), Convert.ToInt32(strInfo[8]));

                                    objRec.BackColor = Color.FromArgb(Convert.ToInt32(strInfo[10]));

                                    switch (strInfo[11].Trim())
                                    {
                                    case "None":
                                        objRec.RectangleBorderStyle = ButtonBorderStyle.None;
                                        break;

                                    case "Dotted":
                                        objRec.RectangleBorderStyle = ButtonBorderStyle.Dotted;
                                        break;

                                    case "Dashed":
                                        objRec.RectangleBorderStyle = ButtonBorderStyle.Dashed;
                                        break;

                                    case "Solid":
                                        objRec.RectangleBorderStyle = ButtonBorderStyle.Solid;
                                        break;

                                    case "Inset":
                                        objRec.RectangleBorderStyle = ButtonBorderStyle.Inset;
                                        break;

                                    case "Outset":
                                        objRec.RectangleBorderStyle = ButtonBorderStyle.Outset;
                                        break;
                                    }

                                    switch (strInfo[12].Trim())
                                    {
                                    case "None":
                                        objRec.BorderStyle = BorderStyle.Fixed3D;
                                        break;

                                    case "FixedSingle":
                                        objRec.BorderStyle = BorderStyle.FixedSingle;
                                        break;

                                    case "Fixed3D":
                                        objRec.BorderStyle = BorderStyle.Fixed3D;
                                        break;
                                    }
                                    objRec.BorderColor = Color.FromArgb(Convert.ToInt32(strInfo[13].Trim()));

                                    objRec.MouseEnter  += new EventHandler(obj.control_MouseEnter);
                                    objRec.MouseLeave  += new EventHandler(obj.control_MouseLeave);
                                    objRec.MouseDown   += new MouseEventHandler(obj.control_MouseDown);
                                    objRec.MouseMove   += new MouseEventHandler(obj.control_MouseMove);
                                    objRec.MouseUp     += new MouseEventHandler(obj.control_MouseUp);
                                    objRec.Click       += obj.ctrl_Click;
                                    objRec.DoubleClick += obj.ctrl_DoubleClick;

                                    objRec.Click += new EventHandler(obj.ctrl_Click);

                                    objRec.MouseLeave += new EventHandler(obj.control_MouseLeave);
                                    obj.Controls.Add(objRec);
                                    obj.Refresh();
                                }
                                else if (strInfo[0] == "Line")
                                {
                                    Line objLable = new Line();
                                    if (strInfo[1] == "True")
                                    {
                                        objLable.Font = new Font(strInfo[2], float.Parse(strInfo[4]), FontStyle.Bold);
                                    }
                                    else
                                    {
                                        objLable.Font = new Font(strInfo[2], float.Parse(strInfo[4]), FontStyle.Regular);
                                    }

                                    objLable.ForeColor = Color.FromArgb(Convert.ToInt32(strInfo[3]));
                                    objLable.Size      = new Size(Convert.ToInt32(strInfo[5]), Convert.ToInt32(strInfo[6]));
                                    objLable.Location  = new Point(Convert.ToInt32(strInfo[7]), Convert.ToInt32(strInfo[8]));
                                    objLable.Text      = strInfo[9];

                                    objLable.BackColor = Color.FromArgb(Convert.ToInt32(strInfo[10]));
                                    obj.Controls.Add(objLable);
                                    obj.Refresh();
                                }
                            }
                        }
                    }
                }
            }
            obj.Refresh();
        }