You do not need/should not trim decimal and group separators from the strings you are trying to parse.
You should instead use
Single.TryParse Method (System) | Microsoft Docs[
^] , especially the overload which lets your specify the culture:
float c, d;
NumberStyles styles = NumberStyles.Float | NumberStyles.AllowThousands;
if (!float.TryParse(TextBox1.Text, styles, CultureInfo.CurrentCulture, out c))
{
}
if (!float.TryParse(TextBox2.Text, styles, CultureInfo.CurrentCulture, out d))
{
}
If you remove decimal separator, there is a great chance that the value you will get will be incorrect (120.23 would become 12023, for example).