//application level subclass from Kevin's stuff public class ammTextBox : OakLeaf.MM.Main.Windows.Forms.mmTextBox { private String _format; [Description("Format for the value"),Category("Data")] public String Format { get { return _format; } set { _format = value; } } //This stuff is here to support formatting string in different cultures private IFormatProvider _formatInfo; [Description("Format provider"),Category("Data")] public IFormatProvider FormatInfo { get { return _formatInfo;} set {_formatInfo = value;} } private TypeConverter typeConverter; public String NullText = "(null)"; public ammTextBox() { } /// <summary> /// Found this hook from debugging through Kevin's code /// Here is where you set up formatter /// </summary> /// <param name="b"></param> public override void RegisterBindingFormatEventHandlers(Binding b) { base.RegisterBindingFormatEventHandlers (b); b.Format +=new ConvertEventHandler(FormatEvent); b.Parse +=new ConvertEventHandler(ParseEvent); } /// <summary> /// This happens when databinding says its time to format bound data in the textbox /// This is where the real work gets done /// </summary> /// <param name="sender"></param> /// <param name="cevent"></param> protected virtual void FormatEvent(object sender, ConvertEventArgs cevent) { if (this._format != null) { cevent.Value = Util.GetText(cevent.Value,this.NullText,this._format,this._formatInfo,this.typeConverter); } } /// <summary> /// This happens when the control's changed value is going to be writen back to /// the datasource /// </summary> /// <param name="sender"></param> /// <param name="cevent"></param> protected virtual void ParseEvent(object sender, ConvertEventArgs cevent) { //if the desired type <> bound type then exit??? object o = cevent.Value; object y = cevent.DesiredType; } } //This is a simple example that just needs to set the format property /// <summary> /// Numeric TextBox. Right aligns the text /// </summary> public class aTextBoxNumeric : ammTextBox { public aTextBoxNumeric() { this.TextAlign = HorizontalAlignment.Right; this.Format = "#,###,##0.00"; } } //This is a more complicated example where I has to override the parse event /// <summary> /// A TextBox for validating Credit card expiration dates /// </summary> public class aTextBoxCreditCardExpiration : ammTextBox { public aTextBoxCreditCardExpiration() { this.Format = "MM/yy"; this.MaxLength = 7; // for mm/yy and mm/yyyy formats } protected override void ParseEvent(object sender, ConvertEventArgs cevent) { base.ParseEvent (sender, cevent); cevent.Value = DateTime.ParseExact((String)cevent.Value, new String[] {"My","M/y","M.y","M-y"}, null, System.Globalization.DateTimeStyles.None); } //this is the utility code /// <summary> /// This code was lifted from the .NET implementation of DataGridTextBoxColumn /// that does support the format property! /// Basically, it gets a string suitable for displaying /// </summary> /// <param name="value"></param> /// <returns></returns> static public string GetText(object value, String nullText, String format, IFormatProvider formatInfo, TypeConverter typeConverter) { string text1; if ((value as DBNull) != null) { return nullText; } if ((format != null) && ((format.Length != 0) && ((value as IFormattable) != null))) { try { text1 = ((IFormattable) value).ToString(format,formatInfo); return text1; } catch (Exception) { goto L_0084; } } if ((typeConverter != null) && typeConverter.CanConvertTo(typeof(string))) { return ((string) typeConverter.ConvertTo(value, typeof(string))); } L_0084: if (value == null) { return ""; } return value.ToString(); }>Where in the MM.Net framework can I plug in binding event handlers for Parse and Format? Is the method 'RegisterBindingFormatEventHandlers' intended to be used for this purpose? If so how would I implement it for specific textbox controls?