Calculate subtotals and totals from a form with many decimal values
Two words: loops and arrays.

There a bunch of variable names that differ only by a number. Whenever you see code like this, you can probably clean it up by creating a collection of those things and looping over them. Basically, you have a checkbox and text field repeated multiple times, and one field where you display the total of all checked fields.


Create a user control to encapsulate the checkbox and text field
Make sure this user control has a public property decimal TotalCost { get } that will:


Return the decimal-parsed values of total - cost for the fields when checked, and zero when unchecked.
Throws an exception if the decimal cannot be parsed

Expose a boolean property bool IsValid that returns true when the user as entered a valid decimals
Expose a public property bool IsChecked that returns whether or not the checkbox is checked
Create a collection of these user controls, one for each checkbox/text field combo on screen


Now loop and process:

decimal purchaseTotal = 0m;
decimal totalAmount = 0m;

foreach (var control in PurchasedItems.Where(p =&gt; p.IsChecked &amp;&amp; p.IsValid))
{
    purchaseTotal += control.TotalCost;
}


I left some details out, but your code isn't really clear on what the UI looks like, or what the business use case is, but it really just boils down to:


Create an abstraction for what each combo of controls represents (e.g. create a new user control)
Create a collection of these controls
Loop and calculate