我试图在 MaskedTextBox 中显示一个百分比,字符串在其“40.99”中传递,但是当它显示在表单上时,它是“409.9%”。
填充值
if (_person.Percentage != null)
maskedTextBoxPercentage.Text = _person.Percentage.ToString();
else
{
maskedTextBoxPercentage.Text = 0.00.ToString();
}
maskedTextBoxPercentage 属性
this.maskedTextBoxPercentage.Location = new System.Drawing.Point(437, 125);
this.maskedTextBoxPercentage.Mask = "000.00%";
this.maskedTextBoxPercentage.Name = "maskedTextBoxPercentage";
this.maskedTextBoxPercentage.Size = new System.Drawing.Size(129, 20);
this.maskedTextBoxPercentage.TabIndex = 65;