Home > Net >  C # a double field after binding the textBox control can't enter the decimal point
C # a double field after binding the textBox control can't enter the decimal point

Time:12-20

Public class IDName
{
String _name;
Public string Name
{
The set {_name=value; }
The get {return _name; }
}

Double _amount;
Public double Amount
{
The set {_amount=value; }
The get {return _amount; }
}
}
IDName _idName=new IDName ();
Public FrmComboBoxTest2 ()
{
InitializeComponent();
TextBox1. DataBindings. Add (_idName "Text", "Name", false, DataSourceUpdateMode. OnPropertyChanged);
TextBox2. DataBindings. Add (_idName "Text", "Amount", false, DataSourceUpdateMode. OnPropertyChanged);
}
For all above code
Below is the input before the decimal point the cursor at the back

Enter a decimal point cursor automatically moved to the front, the decimal point is not displayed, the following figure

Is after the double field bound controls will appear this kind of circumstance, please everyone a great god what is the solution?

CodePudding user response:

Will be binding statements false to true
  •  Tags:  
  • C#
  • Related