コード例 #1
0
        //public frmViewResult(string dataFile)
        //{
        //    InitializeComponent();
        //    this.dataFile = dataFile;
        //    Lines = new List<string>();
        //}
        //public frmViewResult(string dataFile, bool  is_landscape)
        //{
        //    InitializeComponent();
        //    this.dataFile = dataFile;
        //    Lines = new List<string>();
        //    IsLandScape = is_landscape;

        //}

        private void frmViewResult_Load(object sender, EventArgs e)
        {
            //toolTip1.SetToolTip(cmb_step, "Click Here to go STEPS and TABLES quick references.");
            //toolTip1.SetToolTip(lbl_line_col, "Click Here to go this selected lines.");
            if (File.Exists(dataFile))
            {
                pd.DefaultPageSettings.Margins = new System.Drawing.Printing.Margins(20, 20, 20, 50);
                //Chiranjit [2012 09 07]
                //For Steel Truss Design Report
                if ((Path.GetFileNameWithoutExtension(dataFile).ToUpper() == "DESIGN_REP") || IsLandScape)
                {
                    pd.DefaultPageSettings.Landscape = true;
                }
                PageNo                   = 0;
                psd.Document             = pd;
                psd.PageSettings.Margins = new System.Drawing.Printing.Margins(20, 20, 20, 50);
                rtbData.Lines            = File.ReadAllLines(dataFile);


                tslbl_notok.Visible = rtbData.Text.Contains("NOT OK");
                this.Text           = "View Result [" + MyStrings.Get_Modified_Path(dataFile) + "]";
                try
                {
                    //Image img =  AstraFunctionOne.Properties.Resources.BOX_1;
                    //Clipboard.SetImage(img);
                    //rtbData.Paste();
                    SetColor();

                    //Image img = AstraFunctionOne.Properties.Resources.BOX_1;
                    //Clipboard.SetImage(img);
                    //rtbData.Paste();



                    //thd = new Thread(new ThreadStart(RunThread));
                    //thd.Start();
                    SaveFile();
                    Select_Steps();


                    if (lsv_steps.Items.Count == 0)
                    {
                        spc_1.Panel1Collapsed = true;
                    }

                    //spc_1.Panel1Collapsed = (Path.GetFileName(dataFile) == "ANALYSIS_REP.TXT");
                }
                catch (Exception ex) { }

                lbl_line_col.BackColor = Color.Black;
                lbl_line_col.ForeColor = Color.Yellow;
            }
            else
            {
                this.Close();
            }
        }