Тема: помилка System.FormatException: "Input string was not in a correct for
чому помилка як виправити
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace Mudul1._2
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void button2_Click(object sender, EventArgs e)
{
Double x = Double.Parse(tB1.Text);
tB1.Text += Environment.NewLine + "X = " + x.ToString();
Double y = Double.Parse(tB2.Text);
tB2.Text += Environment.NewLine + "Y = " + y.ToString();
Double I = x/y ;
}
private void Form1_Load_1(object sender, EventArgs e)
{
this.BackColor = Color.Blue;// змінює клір фону
tB1.Text = "3.4";
tB2.Text = "2.6";
}
private void button3_Click(object sender, EventArgs e)
{
// кнобка очишчення
tB1.Text = string.Empty;
tB2.Text = string.Empty;
}
private void button4_Click(object sender, EventArgs e)
{
// кнопка виходу
Application.Exit();
}
}
}