I am new to C# and programming in general. I was able to create the required program in Console but want to get one working with Forms as well. I am running into an issue wh
Remove those definitions from button1_Click() method as you use the same names as the class variables inside this method:
int LengthtextBox;
int WidthtextBox;
int HeighttextBox;
And change the name of the variables:
int length;
int width;
int height;
length= int.Parse(LengthtextBox.Text);
width= int.Parse(WidthtextBox.Text);
height= int.Parse(HeighttextBox.Text);
paint = 350;
answer = (length* width* height) / paint;