Guest User

Untitled

a guest
Jun 21st, 2018
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.64 KB | None | 0 0
  1. label1.DataBindings.Add("Text", textBox1, "Text", true,
  2. DataSourceUpdateMode.OnPropertyChanged,
  3. "<NULL>","{0:H}",new MyFormat());
  4.  
  5. string test =(string.Format(_superFormat, "{0}", "this is my arg"));
  6.  
  7. class MyFormat : IFormatProvider, ICustomFormatter
  8. {
  9. string ICustomFormatter.Format(string format, object arg, IFormatProvider formatProvider)
  10. {
  11. string result = ((string)arg).ToUpper();
  12. return result ;
  13. }
  14. object IFormatProvider.GetFormat(Type formatType)
  15. {
  16. if (formatType == typeof(ICustomFormatter))
  17. return this;
  18. else
  19. return null;
  20. }
  21. }
Add Comment
Please, Sign In to add comment