0

I'm trying to create a Wilks Calculator with Windows Forms. I have a Constructor:

public Calculation(double squat, double bench, double deadlift, double weight)

but its parameters are of type double. However, I need the user to input into a TextBox (which is of type string). How do I initialize the constructor with the entries of the textbox?

John M Fecko
  • 105
  • 5
  • 1
    parse your `TextBox.Text` to double, use `double.Parse` or `double.TryParse` – Habib Feb 13 '15 at 13:54
  • My issue is do I do this within the constructor? surely there must be a more elegant solution. Also, doing this in a constructor brings up a System.FormatException Error "Input string was not in a correct format" –  Feb 13 '15 at 14:10

0 Answers0