예제 #1
0
        public Form1()
        {
            InitializeComponent();
            client  =new Cli();

            for (int i = 1; i < 10; i++)
            {
                Button btn = (Button)this.Controls.Find("button"+i, true)[0];
                tlacitka[i-1] = btn;
            }
            barva_tl();
        }
예제 #2
0
        private void button1_Click(object sender, EventArgs e)
        {
            form.barva_tl();

            if (form.pocet < 100)
            {
                Serv srv = new Serv();
                srv.Start(form);
            }
            else
            {
                while (true)
                {
                    try
                    {
                        Cli cli = new Cli();
                        cli.Connect(form);
                    }
                    catch { Thread.Sleep(3000); }

                }
            }
            this.Close();
        }