Esempio n. 1
0
        private void BtValider_Click(object sender, EventArgs e)
        {
            if (flag == 0)
            {
                FolderBrowserDialog_DofusPath.ShowDialog();
                TextBox1.Text  = FolderBrowserDialog_DofusPath.SelectedPath;
                BtValider.Text = "Continuer";
                flag           = 1;
            }
            else
            {
                string directoryPath = Path.Combine(TextBox1.Text, "app", "data", "i18n");

                if (Directory.Exists(directoryPath))
                {
                    mainfrm.DofusPath = TextBox1.Text;
                    string       combinedPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "BlueSheep", "bs.conf");
                    StreamWriter sr           = new StreamWriter(combinedPath);
                    sr.WriteLine(TextBox1.Text);
                    sr.Close();
                    Close();
                    return;
                }
                else
                {
                    System.Windows.Forms.MessageBox.Show("Impossible de trouver le dossier : \"" + directoryPath);
                    flag           = 0;
                    BtValider.Text = "Parcourir";
                    TextBox1.Clear();
                }
            }
        }
 private void temizle()
 {
     TextBox1.Clear();
     TextBox2.Clear();
     TextBox3.Clear();
     TextBox4.Clear();
 }
Esempio n. 3
0
        private void Button2_Click(object sender, EventArgs e)
        {
            if (c.cnn.State == ConnectionState.Open)
            {
                c.cnn.Close();
            }
            c.cnn.Open();

            if (TextBox1.Text == "" || TextBox2.Text == "" || TextBox3.Text == "")
            {
                MessageBox.Show("Fill the form properly", "Reset", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
            else
            {
                sqlcom             = c.cnn.CreateCommand();
                sqlcom.CommandText = "select * from adlogin where AdmName='" + TextBox1.Text + "' and APassword='******'";
                sqldr = sqlcom.ExecuteReader();
                if (sqldr.Read())
                {
                    if (c.cnn.State == ConnectionState.Open)
                    {
                        c.cnn.Close();
                    }
                    c.cnn.Open();
                    sqlcom             = c.cnn.CreateCommand();
                    sqlcom.CommandText = "update adlogin set APassword='******' where AdmName='" + TextBox1.Text + "'";
                    sqldr = sqlcom.ExecuteReader();

                    TextBox1.Clear();
                    TextBox2.Clear();
                    TextBox3.Clear();
                }
            }
        }
Esempio n. 4
0
        private void NumDown(string str)
        {
            if (_plusFlag || _minusFlag || _multiFlag || _divFlag)
            {
                TextBox1.Clear();
                _plusFlag         = false;
                _minusFlag        = false;
                _multiFlag        = false;
                _divFlag          = false;
                _resultFlag       = false;
                _canCalculateFlag = true;
            }

            if ((str.Equals(".") && TextBox1.Text.IndexOf(".") < 0) || (!str.Equals(".")))
            {
                if (_resultFlag)
                {
                    TextBox1.Clear();
                    Label01.Text = TextBox1.Text;
                    _resultFlag  = false;
                }
                TextBox1.Text += str;
                Label01.Text  += str;
            }
        }
        private void Button1_Click(object sender, RoutedEventArgs e)
        {
            int    counter = 0;
            string word    = null;

            if (string.IsNullOrWhiteSpace(TextBox1.Text))
            {
                TextBlock1.Text = "Molim vas unesite tekst";
                return;
            }



            string[] words = TextBox2.Text.Split(" ".ToCharArray());

            foreach (var sentence in words)
            {
                if (!string.IsNullOrEmpty(sentence) && (TextBox1.Text.Contains(sentence)))
                {
                    counter++;
                    word += " " + sentence;
                }
            }

            TextBox1.Clear();
            TextBox2.Clear();
            TextBox1.Focus();

            TextBlock1.Text = $"The same word's are {word} \n and their number is: {counter} ";
        }
Esempio n. 6
0
        private void 새로만들기NToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (Dirty && TextBox1.Text != null)
            {
                if (SaveCheckForm.ShowDialog() == DialogResult.Cancel)
                {
                    return;
                }

                if (SaveCheckForm.DialogResult == DialogResult.OK)
                {
                    if (saveFileDialog1.ShowDialog() == DialogResult.Cancel)
                    {
                        return;
                    }

                    File.WriteAllText(saveFileDialog1.FileName, TextBox1.Text);
                }
            }



            TextBox1.Clear();
            IsDirty();
        }
 public Window1()
 {
     InitializeComponent();
     TextBox1.MaxLength = 5;
     Label1.Content     = "\n(2+5)*8=?";
     TextBox1.Clear();
 }
        private void Button_Click_1(object sender, RoutedEventArgs e)
        {
            if (!File.Exists("Märkmed.xml"))
            {
                MessageBox.Show("Fail puudub");
            }
            else
            {
                string      xmlfilepath = @"D:\programs\Visual Studio 2017\XML Märkmed\MärkmeteHarjutus\MärkmeteHarjutus\bin\Debug\Märkmed.xml";
                XmlDocument doc         = new XmlDocument();
                doc.Load(xmlfilepath);

                XmlNode node1 = doc.SelectSingleNode("/Märkmik/Märge/Pealkiri");
                node1.InnerText = TextBox1.Text;
                XmlNode node2 = doc.SelectSingleNode("/Märkmik/Märge/Sisu");
                node2.InnerText = TextBox2.Text;

                XmlNode node3 = doc.SelectSingleNode("/Märkmik/Märge/Pealkiri");
                TextBox3.Text = node3.InnerText;
                XmlNode node4 = doc.SelectSingleNode("/Märkmik/Märge/Sisu");
                TextBox4.Text = node4.InnerText;

                doc.Save("Märkmed.xml");


                MessageBox.Show("Märge Lisatud");
                //TextBox4.Text = File.ReadAllText("Märkmed.xml");

                TextBox1.Clear();
                TextBox2.Clear();
            }
        }
Esempio n. 9
0
 private void TextBox1_MouseClick(object sender, System.Windows.Forms.MouseEventArgs e)
 {
     if ((TextBox1.Text == "password"))
     {
         TextBox1.Clear();
     }
 }
Esempio n. 10
0
 private void LimparTextBox()
 {
     TextBox1.Clear();
     textBox2.Clear();
     textBox3.Clear();
     textBox5.Clear();
     textBox8.Clear();
 }
Esempio n. 11
0
 private void Monitor(object sender, ElapsedEventArgs e)
 {
     Dispatcher.BeginInvoke(new Action(() => {
         TextBox1.Clear();
     }));
     GetNodesBlockCount();
     AnalyseResults();
 }
Esempio n. 12
0
 private void MaakLeeg()
 {
     if (nieuwGetal)
     {
         TextBox1.Clear();
         nieuwGetal = false;
     }
 }
Esempio n. 13
0
 private void button9_Click(object sender, EventArgs e)
 {
     TextBox1.Clear();
     TextBox2.Clear();
     TextBox3.Clear();
     TextBox4.Clear();
     textBox5.Clear();
 }
Esempio n. 14
0
 private void button15_Click(object sender, EventArgs e)
 {
     num = float.Parse(TextBox1.Text);
     TextBox1.Clear();
     TextBox1.Focus();
     count       = 4;
     label1.Text = num.ToString() + "/";
 }
Esempio n. 15
0
 private void TextBox1_TextChanged(object sender, TextChangedEventArgs e)         //Тут происходит проверка на ввод букв, если буквы, то ругаемся!
 {
     if (System.Text.RegularExpressions.Regex.IsMatch(TextBox1.Text, "[^0-9]"))
     {
         MessageBox.Show("В данном поле разрешены только цифры (╯°□°)╯┻━┻");
         TextBox1.Clear();
     }
 }
Esempio n. 16
0
 private void ClearScreen(object sender, ElapsedEventArgs e)
 {
     Dispatcher.BeginInvoke(new Action(() =>
     {
         TextBox1.Clear();
         TextBox0.Clear();
     }));
 }
Esempio n. 17
0
        private void bunifuFlatButton1_Click(object sender, EventArgs e)
        {
            var Var4 = TextBox1.Text;
            var Var5 = comboBox1.SelectedItem;
            var Var6 = comboBox2.SelectedItem;
            var Var7 = dateTimePicker1.Value.ToString();
            var Var9 = textBox2.Text;

            if (Var4 == "" || comboBox1.Text == "" || comboBox2.Text == "" || textBox2.Text == "")
            {
                MessageBox.Show("all fields required");
            }
            else
            {
                Random Var8 = new Random();
                int    aa   = Var8.Next(1, 1000);

                SqlDataAdapter adapter = new SqlDataAdapter();
                string         sql     = null;
                SqlConnection  cnn     = new SqlConnection(@"Data Source=(LocalDB)\MSSQLLocalDB;AttachDbFilename=C:\Users\mohamed chagour\Documents\Leoni.mdf;Integrated Security=True;Connect Timeout=30");
                //Tester sur code
                SqlDataAdapter sda = new SqlDataAdapter("Select count(*) from pc where code='" + aa + "'", cnn);
                DataTable      dt  = new DataTable();
                sda.Fill(dt);
                while (dt.Rows[0][0].Equals(1))
                {
                    aa = Var8.Next(1, 1000);
                }

                sql = "insert into pc (nom, ps,action,date,code,num) values('" + Var4 + "','" + Var5 + "','" + Var6 + "','" + Var7 + "','" + aa + "','" + Var9 + "')";


                SqlDataAdapter sda1 = new SqlDataAdapter("select count(nom) from pc where nom = '" + Var4 + "'", cnn);
                DataTable      dt1  = new DataTable();
                sda1.Fill(dt1);
                if (dt1.Rows[0][0].ToString() == "1")
                {
                    MessageBox.Show("Pc name already exist");
                }
                else
                {
                    cnn.Open();
                    adapter.InsertCommand = new SqlCommand(sql, cnn);
                    adapter.InsertCommand.ExecuteNonQuery();
                    MessageBox.Show("You PC Code is " + aa);

                    string[] lines = { "^Q30,3", "^W50", "^H5", "^P1", "^S2", "^AD", "^C1", "^R0", "~Q+0", "^O0", "^D0", "^E12", "~R200", "^XSET,ROTATION,0", "^L", "Dy2-me-dd", "Th:m:s", "AD,10,54,1,1,0,0E,Nom PC:", "AD,10,120,1,1,0,0E,Code:", "AD,150,54,1,1,0,0E," + Var4 + "", "AD,108,122,1,1,0,0E," + aa + "", "E", "" };
                    System.IO.File.WriteAllLines(@"C:\Users\mohamed chagour\source\repos\WindowsFormsApp1\WindowsFormsApp1\bin\Debug\etiquette.txt", lines);

                    Process.Start(@"C:\Users\mohamed chagour\source\repos\WindowsFormsApp1\WindowsFormsApp1\bin\Debug\etiquette.bat");
                }

                textBox2.Clear();
                TextBox1.Clear();
                comboBox1.Refresh();
                TextBox1.Select();
            }
        }
Esempio n. 18
0
 private void ResetRecord()
 {
     DateTimePicker1.Value = DateTime.Now;
     TextBox1.Clear();
     TextBox2.Clear();
     TextBox3.Clear();
     btnadd.Text = "Add";
     DateTimePicker1.Focus();
 }
Esempio n. 19
0
 private void DeliteRecord_Click(object sender, RoutedEventArgs e)
 {
     AllRecords.RemoveAt(ListView1.SelectedIndex);
     TextBox1.Clear();
     TextBox2.Clear();
     TextBox3.Clear();
     TextBox4.Clear();
     MessageBox.Show("Complite!");
 }
Esempio n. 20
0
 private void limpiar()
 {
     TextBox1.Clear();
     TextBox4.Clear();
     textBox5.Clear();
     TextBox6.Clear();
     TextBox7.Clear();
     TextBox3.Clear();
 }
Esempio n. 21
0
 private void NewMenu1_Click(object sender, EventArgs e)
 {
     NewDocumentNumber++;
     TheTextFileName  = string.Format("Document{0}.txt", NewDocumentNumber);
     OriginalFileText = "";
     TextBox1.Clear();
     NewDocument       = true;
     TextBox1.Modified = false;
     UpdateFormCaption();
 }
Esempio n. 22
0
 private void Open()
 {
     if (OpenFileDialog1.ShowDialog() == DialogResult.OK)
     {
         TextBox1.Clear();
         TextBox1.Text = File.ReadAllText(OpenFileDialog1.FileName);
         FileName      = string.Format("{0} -Windows 메모장", Path.GetFileName(OpenFileDialog1.FileName));
         this.Text     = FileName;
     }
 }
Esempio n. 23
0
        private void buttonDivide_Click(object sender, EventArgs e)
        {
            num1 += decimal.Parse(TextBox1.Text);
            TextBox1.Clear();

            ClickPlus   = false;
            ClickMinus  = false;
            ClickMult   = false;
            ClickDivide = true;
        }
Esempio n. 24
0
        private void Button_Click_1(object sender, RoutedEventArgs e)
        {
            TextBox1.Clear();
            string a = "";

            foreach (string txt in lines)
            {
                a             = a + txt + "/r/n/t/t";
                TextBox1.Text = a;
            }
        }
Esempio n. 25
0
        private void button4_Click(object sender, EventArgs e)
        {
            int    length = TextBox1.TextLength - 1;
            string text   = TextBox1.Text;

            TextBox1.Clear();
            for (int i = 0; i < length; i++)
            {
                TextBox1.Text = TextBox1.Text + text[i];
            }
        }
 private void Button3_Click(object sender, EventArgs e)
 {
     TextBox2.Clear();
     ComboBox1.Text = "";
     TextBox4.Clear();
     TextBox1.Clear();
     TextBox3.Clear();
     TextBox5.Clear();
     textBox6.Clear();
     TextBox2.Focus();
 }
Esempio n. 27
0
 public void ClearTextBoxes()
 {
     TextBox1.Clear();
     TextBox2.Clear();
     TextBox3.Clear();
     TextBox4.Clear();
     TextBox5.Clear();
     TextBox6.Clear();
     TextBox7.Clear();
     TextBox8.Clear();
     TextBoxID.Clear();
 }
Esempio n. 28
0
 private void ChangeRecord_Click(object sender, RoutedEventArgs e)
 {
     if (Check())
     {
         AllRecords.RemoveAt(ListView1.SelectedIndex);
         AllRecords.Add(new Record(TextBox1.Text, TextBox2.Text, TextBox3.Text, TextBox4.Text));
         TextBox1.Clear();
         TextBox2.Clear();
         TextBox3.Clear();
         TextBox4.Clear();
         MessageBox.Show("Complite!");
     }
 }
        /*private void Button_Click_3(object sender, RoutedEventArgs e)
         * {
         *  try
         *  {
         *      Text1.Clear();
         *  }
         *  catch
         *  {
         *  }
         * }*/

        private void Button_Click_4(object sender, RoutedEventArgs e)
        {
            try
            {
                TextBox1.Clear();
                TextBox2.Clear();
                TextBox3.Clear();
                TextBox4.Clear();
            }
            catch
            {
            }
        }
 private void Button2_Click(object sender, EventArgs e)
 {
     TextBox1.Clear();
     TextBox2.Clear();
     TextBox3.Clear();
     TextBox4.Clear();
     TextBox5.Clear();
     MessageBox.Show("Se ha eliminado el reporte.",
                     "Importante",
                     MessageBoxButtons.OK,
                     MessageBoxIcon.Exclamation,
                     MessageBoxDefaultButton.Button1);
 }