You have two problems:
You can't name a variable -k. If you want it to be the negative of Z you just have to name it K and set it to -Z.
Secondly if statements don't have a ; at the end of them. That is effectively ending your if statment. Here is code that should do what you want:
<pre>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 Heat_conduction_calculator_9
{
public partial class Form1 : Form
{
double A, q, k, T1, T2, x1, x2, Z;
public Form1()
{
InitializeComponent();
Z = -1.0E-99;
A = T1 = T2 = x1 = x2 = Z;
k = -Z;
}
private void button1_Click(object sender, EventArgs e)
{
x1 = double.Parse(textBox1.Text);
T1 = double.Parse(textBox2.Text);
x2 = double.Parse(textBox3.Text);
T2 = double.Parse(textBox4.Text);
k = double.Parse(textBox5.Text);
A = double.Parse(textBox6.Text);
if ((A >= Z) && (-k >= Z) && (x1 >= Z) && (x2 >= Z) && (T1 >= Z) && (T2 >= Z))
{
q = (-1 * k * A * (T2 - T1) / (x2 - x1));
textBox7.Text = q.ToString();
}
else if ((A <= Z) | (-k <= Z) | (x1 <= Z) | (x2 <= Z) | (T1 <= Z) | (T2 <= Z))
MessageBox.Show("Invalid Input");
}
}
}