System.Windows.Forms.ConvertEventArgs.Value Property

Gets or sets the value of the System.Windows.Forms.ConvertEventArgs.

Syntax

public object Value { set; get; }

Value

Documentation for this section has not yet been entered.

Remarks

The value contained by the ConvertEventArgs.Value property depends on the event in which the System.Windows.Forms.ConvertEventArgs is returned. The System.Windows.Forms.ConvertEventArgs can be returned in either the Binding.Format event or the Binding.Parse event.

When the System.Windows.Forms.ConvertEventArgs is returned in the Binding.Format event, the ConvertEventArgs.Value property contains the unformatted property value of the data source. Within the Binding.Format event, you can read the property value, format the value, and reset the ConvertEventArgs.Value property to the new (formatted) value, thereby setting the value displayed in the data-bound control.

When the System.Windows.Forms.ConvertEventArgs is returned in the Binding.Parse event, the property contains the custom-formatted value of the data-bound control. Within the Binding.Parse event, you must read the formatted value, parse it, and convert it back to the same data type as the data source. You can then reset the ConvertEventArgs.Value property to the unformatted value, and thereby set the value of the data source. To determine the type of the data source, examine the ConvertEventArgs.DesiredType property value.

Requirements

Namespace: System.Windows.Forms
Assembly: System.Windows.Forms (in System.Windows.Forms.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0