Binding.FormattingEnabled Property


获取或设置一个值,该值指示是否对控件属性数据应用类型转换和格式设置。Gets or sets a value indicating whether type conversion and formatting is applied to the control property data.

 property bool FormattingEnabled { bool get(); void set(bool value); };
public bool FormattingEnabled { get; set; }
member this.FormattingEnabled : bool with get, set
Public Property FormattingEnabled As Boolean

Property Value


如果已针对控件属性数据启用类型转换和格式设置,则为 true;否则为 falsetrue if type conversion and formatting of control property data is enabled; otherwise, false. 默认为 falseThe default is false.


如果将此属性设置为 true 还会启用错误处理行为,并引发 BindingComplete 事件。Setting this property to true also enables error-handling behavior and causes the BindingComplete event to be raised. 此事件的处理程序可以通过检查 BindingCompleteEventArgs 参数的 BindingCompleteState 属性,根据绑定过程中的成功、错误或异常,采取相应的操作。The handler of this event can take the appropriate action, based on the success, error, or exceptions in the binding process, by examining the BindingCompleteState property of the BindingCompleteEventArgs parameter.

Applies to

See also