Ejemplo n.º 1
0
        private void button2_Click(object sender, EventArgs e)
        {
            pictureBox4.Visible = true;
            //Thread th = new Thread(new ThreadStart(WorkThread));
            //th.Start();

            // DELETE THIS CHANGES
            textBox1.Text = " ";
            textBox2.Text = " ";

            //log.Debug("Click to do connection");
            if (textBox1.Text.Equals(""))
            {
                pictureBox2.Visible = true;

            }
            else if (textBox2.Text.Equals(""))
            {
                pictureBox3.Visible = true;
            }
            else
            {
                pictureBox2.Visible = false;
                pictureBox3.Visible = false;
                //mysqlc = new MysqlC(textBox1.Text, textBox2.Text, "localhost", "questionnairex");

                //BY DEFALYT CONNECTION!!!
                mysqlc = new MysqlC("root", "123456", "localhost", "questionnairex");
                mysqlc.initializeConnection();
                if (mysqlc.Return_Connection()!=null)
                {
                    //Stop the graphics.
                    pictureBox4.Visible = false;

                    //System.Windows.Forms.MessageBox.Show(Messages.Connection_str);
                    //Add a new event to close the window form
                    this.form1_FormClosed(sender,e);
                }
            }
        }
Ejemplo n.º 2
0
 private void Form1_Load(object sender, EventArgs e)
 {
     mysqlc = null;
     comboBox1.Items.Add("English");
     comboBox1.Items.Add("Ελληνικά");
     comboBox1.SelectedIndex = 0;
     this.FormClosed += new FormClosedEventHandler(form1_FormClosed);
 }