I have multiple textboxes left-aligned vertically. They show numbers with floating points and signs. The numbers are continuously changing. I'd like to make the position of the floating point fixed so that when the numbers are changed the position of the floating points are unchanged and keep aligned vertically in all of the textboxes.
This is what I have tried:
textbox1.Text = number1.ToString("#000.00000");
textbox2.Text = number2.ToString("#000.00000");
textbox3.Text = number3.ToString("#000.00000");
textbox4.Text = number4.ToString("#000.00000");
It works when the numbers are negative and I see - sign in the beginning, but when they are positive the numbers are shifted to the left. I can manually add space or + sign to the beginning of the positive numbers, but I am wondering if there a more elegant approach for this. Also when the numbers are like 3.2, this will change them to 003.20000, Is there anyway to make it so that the additional zeros are changed to space?