how to get string value entered in numericupdown silverlight control?

后端 未结 1 1562
刺人心
刺人心 2021-01-24 07:30

I am using silver-light numeric up-down control. Control is set for decimal numbers.

Maximum limit 28 and minimum limit is -28

Incremen

1条回答
  •  轻奢々
    轻奢々 (楼主)
    2021-01-24 08:05

    Create a subclass of NumericUpDown and override the ParseValue method:

    public class MyNumericUpDown : NumericUpDown {
    
      protected override double ParseValue(string text)
      {
         // Change text to whatever you want
         string newText = FixText(text);
    
         // Call base implementation.
         base.ParseValue(newText);
      }
    
      private static string FixText(string inputText) {
        // DO YOUR STUFF HERE.
      } 
    }
    

    0 讨论(0)
提交回复
热议问题