Ejemplo n.º 1
0
 /// <summary>
 /// Required method for Designer support - do not modify
 /// the contents of this method with the code editor.
 /// </summary>
 private void InitializeComponent()
 {
     HZH_Controls.Controls.TimeLineItem timeLineItem1 = new HZH_Controls.Controls.TimeLineItem();
     HZH_Controls.Controls.TimeLineItem timeLineItem2 = new HZH_Controls.Controls.TimeLineItem();
     HZH_Controls.Controls.TimeLineItem timeLineItem3 = new HZH_Controls.Controls.TimeLineItem();
     HZH_Controls.Controls.TimeLineItem timeLineItem4 = new HZH_Controls.Controls.TimeLineItem();
     this.ucTimeLine = new HZH_Controls.Controls.UCTimeLine();
     this.SuspendLayout();
     //
     // ucTimeLine
     //
     this.ucTimeLine.AutoScroll      = true;
     this.ucTimeLine.DetailsFont     = new System.Drawing.Font("微软雅黑", 10F);
     this.ucTimeLine.DetailsForcolor = System.Drawing.Color.FromArgb(((int)(((byte)(144)))), ((int)(((byte)(147)))), ((int)(((byte)(153)))));
     this.ucTimeLine.Dock            = System.Windows.Forms.DockStyle.Fill;
     timeLineItem1.Details           = "2020年01月发生了一件大事,咔嚓一声打了一个炸雷,咔嚓一声打了一个炸雷,咔嚓一声打了一个炸雷,咔嚓一声打了一个炸雷,咔嚓一声打了一个炸雷,咔嚓一声打了一个炸雷" +
                                       ",咔嚓一声打了一个炸雷,咔嚓一声打了一个炸雷,咔嚓一声打了一个炸雷,然后王二麻子他爹王咔嚓出生了。";
     timeLineItem1.Title   = "2020年01月";
     timeLineItem2.Details = "2020年02月发生了一件大事,咔嚓一声打了一个炸雷,咔嚓一声打了一个炸雷,咔嚓一声打了一个炸雷,咔嚓一声打了一个炸雷,咔嚓一声打了一个炸雷,咔嚓一声打了一个炸雷" +
                             ",咔嚓一声打了一个炸雷,咔嚓一声打了一个炸雷,咔嚓一声打了一个炸雷,然后王二麻子他爹王咔嚓出生了。";
     timeLineItem2.Title   = "2020年02月";
     timeLineItem3.Details = "2020年03月发生了一件大事,咔嚓一声打了一个炸雷,咔嚓一声打了一个炸雷,咔嚓一声打了一个炸雷,咔嚓一声打了一个炸雷,咔嚓一声打了一个炸雷,咔嚓一声打了一个炸雷" +
                             ",咔嚓一声打了一个炸雷,咔嚓一声打了一个炸雷,咔嚓一声打了一个炸雷,然后王二麻子他爹王咔嚓出生了。";
     timeLineItem3.Title   = "2020年03月";
     timeLineItem4.Details = "2020年04月发生了一件大事,咔嚓一声打了一个炸雷,咔嚓一声打了一个炸雷,咔嚓一声打了一个炸雷,咔嚓一声打了一个炸雷,咔嚓一声打了一个炸雷,咔嚓一声打了一个炸雷" +
                             ",咔嚓一声打了一个炸雷,咔嚓一声打了一个炸雷,咔嚓一声打了一个炸雷,然后王二麻子他爹王咔嚓出生了。";
     timeLineItem4.Title   = "2020年04月";
     this.ucTimeLine.Items = new HZH_Controls.Controls.TimeLineItem[] {
         timeLineItem1,
         timeLineItem2,
         timeLineItem3,
         timeLineItem4
     };
     this.ucTimeLine.LineColor     = System.Drawing.Color.FromArgb(((int)(((byte)(144)))), ((int)(((byte)(147)))), ((int)(((byte)(153)))));
     this.ucTimeLine.Location      = new System.Drawing.Point(0, 61);
     this.ucTimeLine.Name          = "ucTimeLine";
     this.ucTimeLine.Padding       = new System.Windows.Forms.Padding(30, 0, 0, 0);
     this.ucTimeLine.Size          = new System.Drawing.Size(962, 507);
     this.ucTimeLine.TabIndex      = 7;
     this.ucTimeLine.TitleFont     = new System.Drawing.Font("微软雅黑", 14F);
     this.ucTimeLine.TitleForcolor = System.Drawing.Color.FromArgb(((int)(((byte)(48)))), ((int)(((byte)(49)))), ((int)(((byte)(51)))));
     this.ucTimeLine.Load         += new System.EventHandler(this.ucTimeLine_Load);
     //
     // RecordForm
     //
     this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 17F);
     this.AutoScaleMode       = System.Windows.Forms.AutoScaleMode.Font;
     this.ClientSize          = new System.Drawing.Size(962, 568);
     this.Controls.Add(this.ucTimeLine);
     this.IsShowCloseBtn = true;
     this.Name           = "RecordForm";
     this.Text           = "RecordForm";
     this.Title          = "记录";
     this.Controls.SetChildIndex(this.ucTimeLine, 0);
     this.ResumeLayout(false);
 }
Ejemplo n.º 2
0
 /// <summary>
 /// 设计器支持所需的方法 - 不要
 /// 使用代码编辑器修改此方法的内容。
 /// </summary>
 private void InitializeComponent()
 {
     HZH_Controls.Controls.TimeLineItem timeLineItem5 = new HZH_Controls.Controls.TimeLineItem();
     HZH_Controls.Controls.TimeLineItem timeLineItem6 = new HZH_Controls.Controls.TimeLineItem();
     HZH_Controls.Controls.TimeLineItem timeLineItem7 = new HZH_Controls.Controls.TimeLineItem();
     HZH_Controls.Controls.TimeLineItem timeLineItem8 = new HZH_Controls.Controls.TimeLineItem();
     this.ucTimeLine1 = new HZH_Controls.Controls.UCTimeLine();
     this.SuspendLayout();
     //
     // ucTimeLine1
     //
     this.ucTimeLine1.AutoScroll      = true;
     this.ucTimeLine1.DetailsFont     = new System.Drawing.Font("微软雅黑", 10F);
     this.ucTimeLine1.DetailsForcolor = System.Drawing.Color.FromArgb(((int)(((byte)(144)))), ((int)(((byte)(147)))), ((int)(((byte)(153)))));
     this.ucTimeLine1.Dock            = System.Windows.Forms.DockStyle.Fill;
     timeLineItem5.Details            = "2019年07月发生了一件大事,咔嚓一声打了一个炸雷,咔嚓一声打了一个炸雷,咔嚓一声打了一个炸雷,咔嚓一声打了一个炸雷,咔嚓一声打了一个炸雷,咔嚓一声打了一个炸雷" +
                                        ",咔嚓一声打了一个炸雷,咔嚓一声打了一个炸雷,咔嚓一声打了一个炸雷,然后王二麻子他爹王咔嚓出生了。";
     timeLineItem5.Title   = "2019年07月";
     timeLineItem6.Details = "2019年08月发生了一件大事,咔嚓一声打了一个炸雷,咔嚓一声打了一个炸雷,咔嚓一声打了一个炸雷,咔嚓一声打了一个炸雷,咔嚓一声打了一个炸雷,咔嚓一声打了一个炸雷" +
                             ",咔嚓一声打了一个炸雷,咔嚓一声打了一个炸雷,咔嚓一声打了一个炸雷,然后王二麻子他爹王咔嚓出生了。";
     timeLineItem6.Title   = "2019年08月";
     timeLineItem7.Details = "2019年09月发生了一件大事,咔嚓一声打了一个炸雷,咔嚓一声打了一个炸雷,咔嚓一声打了一个炸雷,咔嚓一声打了一个炸雷,咔嚓一声打了一个炸雷,咔嚓一声打了一个炸雷" +
                             ",咔嚓一声打了一个炸雷,咔嚓一声打了一个炸雷,咔嚓一声打了一个炸雷,然后王二麻子他爹王咔嚓出生了。";
     timeLineItem7.Title   = "2019年09月";
     timeLineItem8.Details = "2019年10月发生了一件大事,咔嚓一声打了一个炸雷,咔嚓一声打了一个炸雷,咔嚓一声打了一个炸雷,咔嚓一声打了一个炸雷,咔嚓一声打了一个炸雷,咔嚓一声打了一个炸雷" +
                             ",咔嚓一声打了一个炸雷,咔嚓一声打了一个炸雷,咔嚓一声打了一个炸雷,然后王二麻子他爹王咔嚓出生了。";
     timeLineItem8.Title    = "2019年10月";
     this.ucTimeLine1.Items = new HZH_Controls.Controls.TimeLineItem[] {
         timeLineItem5,
         timeLineItem6,
         timeLineItem7,
         timeLineItem8
     };
     this.ucTimeLine1.LineColor     = System.Drawing.Color.FromArgb(((int)(((byte)(144)))), ((int)(((byte)(147)))), ((int)(((byte)(153)))));
     this.ucTimeLine1.Location      = new System.Drawing.Point(0, 0);
     this.ucTimeLine1.Name          = "ucTimeLine1";
     this.ucTimeLine1.Padding       = new System.Windows.Forms.Padding(30, 0, 0, 0);
     this.ucTimeLine1.Size          = new System.Drawing.Size(768, 542);
     this.ucTimeLine1.TabIndex      = 0;
     this.ucTimeLine1.TitleFont     = new System.Drawing.Font("微软雅黑", 14F);
     this.ucTimeLine1.TitleForcolor = System.Drawing.Color.FromArgb(((int)(((byte)(48)))), ((int)(((byte)(49)))), ((int)(((byte)(51)))));
     //
     // UCTestTimeLine
     //
     this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
     this.AutoScaleMode       = System.Windows.Forms.AutoScaleMode.Font;
     this.BackColor           = System.Drawing.Color.White;
     this.Controls.Add(this.ucTimeLine1);
     this.Name = "UCTestTimeLine";
     this.Size = new System.Drawing.Size(768, 542);
     this.ResumeLayout(false);
 }
Ejemplo n.º 3
0
        private void Form1_Load(object sender, EventArgs e)
        {
            timer1.Interval = 1000;
            timer1.Start();
            //Image img = System.Drawing.Image.FromFile(@"E:\生产预警系统\VoiceAlarm\VoiceAlarm\Resource\sg2.PNG");
            //Bitmap ptmap = new Bitmap(img);
            //ptmap.MakeTransparent(Color.White);
            pictureBox1.Image    = KnockOutGzf(@"E:\生产预警系统\VoiceAlarm\VoiceAlarm\Resource\sg2.PNG");
            this.FormBorderStyle = FormBorderStyle.None;
            //this.MaximumSize = new Size(Screen.PrimaryScreen.WorkingArea.Width, Screen.PrimaryScreen.WorkingArea.Height);
            this.WindowState = System.Windows.Forms.FormWindowState.Maximized;
            txtwd.Text       = wdj.Value.ToString();
            Color[] myclolr = new Color[] { Color.Red, Color.Green, Color.Yellow };
            //L1.LampColor = myclolr;
            //L1.TwinkleSpeed = 1000;
            List <string[]> List = new List <string[]>();

            string[] event1 = new string[2];
            event1[0] = DateTime.Now.ToShortDateString();
            event1[1] = "电极1开启";
            List.Add(event1);
            string[] event2 = new string[2];
            event2[0] = DateTime.Now.ToShortDateString();
            event2[1] = "电极2开启";
            List.Add(event2);
            string[] event3 = new string[2];
            event3[0] = DateTime.Now.ToShortDateString();
            event3[1] = "电极2开启";
            List.Add(event3);
            string[] event4 = new string[2];
            event4[0] = DateTime.Now.ToShortDateString();
            event4[1] = "电极2开启";
            List.Add(event4);
            string[] event5 = new string[2];
            event5[0] = DateTime.Now.ToShortDateString();
            event5[1] = "电极2开启";
            List.Add(event5);
            string[] event6 = new string[2];
            event6[0] = DateTime.Now.ToShortDateString();
            event6[1] = "电极2开启";
            List.Add(event6);
            string[] event7 = new string[2];
            event7[0] = DateTime.Now.ToShortDateString();
            event7[1] = "电极2开启";
            List.Add(event7);
            string[] event8 = new string[2];
            event8[0] = DateTime.Now.ToShortDateString();
            event8[1] = "电极2开启";
            List.Add(event8);
            HZH_Controls.Controls.TimeLineItem[] t = new HZH_Controls.Controls.TimeLineItem[List.Count];
            for (int i = 0; i < List.Count; i++)
            {
                t[i] = new HZH_Controls.Controls.TimeLineItem()
                {
                    Title = List[i][0], Details = List[i][1]
                };
            }
            string filename = DateTime.Now.ToShortDateString() + ".txt";
            string path     = Path.GetDirectoryName(Application.ExecutablePath) + "\\LogFile\\";

            path = path + filename;
            for (int i = 0; i < t.GetLength(0); i++)
            {
                WriteText(t[i].Title.ToString() + t[i].Details.ToString(), path);
            }
            //t[0] = new HZH_Controls.Controls.TimeLineItem() { Title = DateTime.Now.ToString(), Details = "打开电极1" };
            ucTimeLine1.Items = t;
            ucTimeLine1.VerticalScroll.Value = ucTimeLine1.ClientSize.Height;
        }