Beispiel #1
0
 private void textBox2_TextChanged(object sender, EventArgs e)
 {
     if (System.Text.RegularExpressions.Regex.IsMatch(textBox2.Text, "[^0-9]"))
     {
         MessageBox.Show("Ievadit var tikai skaitli!");
         LogToFile.LogWrite($"Kludaina ievade, var ievadit tikai skaitlus, ievadita vertiba: {textBox2.Text}");
         textBox2.Text = textBox2.Text.Remove(textBox2.Text.Length - 1);
     }
 }
Beispiel #2
0
        private void button1_Click(object sender, EventArgs e)
        {
            if (textBox1.Text.Equals("") || textBox2.Text.Equals(""))
            {
                MessageBox.Show("Kads no laukiem atstats tuksh");
            }
            else
            {
                double skaitlis1 = double.Parse(textBox1.Text);
                double skaitlis2 = double.Parse(textBox2.Text);
                double rezultats = (skaitlis1 / 100) * skaitlis2;

                label3.Visible = true;
                label3.Text    = $"{skaitlis1} procenti no {skaitlis2} ir = {rezultats}!";

                LogToFile.LogWrite($"Veikta aprekinasana: {skaitlis1} procenti no {skaitlis2} ir = {rezultats}!");
            }
        }
Beispiel #3
0
 public Form1()
 {
     InitializeComponent();
     LogToFile.LogWrite("Inicializeta forma...");
 }