using System; using System.Text; using System.IO; using System.Linq; using System.Drawing; using System.Diagnostics; using System.Windows.Forms; using System.Threading; using System.Threading.Tasks; using System.Collections.Generic; using Tango.PMR.Stubs; using Tango.Stubs; bool i = true; //-------------------------------------------------------------------------------- public void OnExecute(StubManager stubManager) { Form form1 = new Form(); // Set the caption bar text of the form. form1.TopMost = true; form1.Text = "RTFU Test"; form1.FormBorderStyle = FormBorderStyle.FixedDialog; form1.MaximizeBox = false; form1.MinimizeBox = false; form1.StartPosition = FormStartPosition.CenterScreen; form1.AutoSize = true; form1.AutoSizeMode = AutoSizeMode.GrowAndShrink; // Create buttons to Run. Button button1 = new Button () { Width = 100, Height = 100, }; button1.Text = "Run"; button1.Location = new Point (40, 100); form1.Controls.Add(button1); //-----RTFU Serial Number ----------- Label Label1 = new Label () { Width = 150, Height = 20, Text =" RTFU S/N" }; Label1.Location = new Point (30, 10); form1.Controls.Add(Label1); TextBox TextBox1 = new TextBox () { Width = 100, Height = 10, Text ="" }; TextBox1.Location = new Point (40, 40); form1.Controls.Add(TextBox1); //----------LOCATION---------- Label Label3 = new Label () { Width = 150, Height = 20, Text ="LOCATION" }; Label3.Location = new Point (350, 10); form1.Controls.Add(Label3); TextBox TextBox3 = new TextBox () { Width = 100, Height = 10, Text ="" }; TextBox3.Location = new Point (360, 40); form1.Controls.Add(TextBox3); Label Label5 = new Label () { Width = 120, Height =100, Text = "" }; Label5.Location = new Point (300, 100); Label5.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D; Label5.Text=""; Label5.Font = new Font("Arial", 24,FontStyle.Bold); form1.Controls.Add(Label5); //-------------------------------------------------------------------------------- button1.Click += (_,__) => { Label5.Text="Pros"; ///???? not working //------------------------------- start test ----------- Thread.Sleep(5000); //delay 10 second if (i==true) Label5.Text="Fail"; else Label5.Text="Pass"; i= !i; TextBox1.Text=""; }; form1.ShowDialog(); return ; }