1 <?xml version="1.0" encoding="utf-8"?>
2 <Type Name="ConvertEventArgs" FullName="System.Windows.Forms.ConvertEventArgs">
3 <TypeSignature Language="C#" Value="public class ConvertEventArgs : EventArgs" />
5 <AssemblyName>System.Windows.Forms</AssemblyName>
6 <AssemblyVersion>1.0.5000.0</AssemblyVersion>
7 <AssemblyVersion>2.0.0.0</AssemblyVersion>
10 <BaseTypeName>System.EventArgs</BaseTypeName>
15 <attribution license="cc4" from="Microsoft" modified="false" />
16 <para>The <see cref="T:System.Windows.Forms.ConvertEventArgs" /> is used to format and unformat values displayed by a Windows Forms control that is bound to data through a <see cref="T:System.Windows.Forms.Binding" /> object. The <see cref="E:System.Windows.Forms.Binding.Format" /> event occurs whenever a control property is bound to a value and the <see cref="E:System.Windows.Forms.Binding.Parse" /> event occurs whenever the bound value changes.</para>
17 <para>The <see cref="E:System.Windows.Forms.Binding.Format" /> and <see cref="E:System.Windows.Forms.Binding.Parse" /> events allow you to create custom formats for displaying data. For example, if the data in a table is of type <see cref="T:System.Decimal" />, you can specify that the data should be displayed in the local currency format--by setting the <see cref="P:System.Windows.Forms.ConvertEventArgs.Value" /> property of the <see cref="T:System.Windows.Forms.ConvertEventArgs" /> to the formatted value in the <see cref="E:System.Windows.Forms.Binding.Format" /> event. You must consequently unformat the displayed value in the <see cref="E:System.Windows.Forms.Binding.Parse" /> event.</para>
18 <para>For more information about handling events, see <format type="text/html"><a href="01E4F1BC-E55E-413F-98C7-6588493E5F67">[<topic://cpconEventsOverview>]</a></format>.</para>
21 <attribution license="cc4" from="Microsoft" modified="false" />
22 <para>Provides data for the <see cref="E:System.Windows.Forms.Binding.Format" /> and <see cref="E:System.Windows.Forms.Binding.Parse" /> events.</para>
26 <Member MemberName=".ctor">
27 <MemberSignature Language="C#" Value="public ConvertEventArgs (object value, Type desiredType);" />
28 <MemberType>Constructor</MemberType>
30 <Parameter Name="value" Type="System.Object" />
31 <Parameter Name="desiredType" Type="System.Type" />
34 <remarks>To be added.</remarks>
36 <attribution license="cc4" from="Microsoft" modified="false" />
37 <para>Initializes a new instance of the <see cref="T:System.Windows.Forms.ConvertEventArgs" /> class.</para>
40 <attribution license="cc4" from="Microsoft" modified="false" />An <see cref="T:System.Object" /> that contains the value of the current property. </param>
41 <param name="desiredType">
42 <attribution license="cc4" from="Microsoft" modified="false" />The <see cref="T:System.Type" /> of the value. </param>
45 <AssemblyVersion>1.0.5000.0</AssemblyVersion>
46 <AssemblyVersion>2.0.0.0</AssemblyVersion>
49 <Member MemberName="DesiredType">
50 <MemberSignature Language="C#" Value="public Type DesiredType { get; }" />
51 <MemberType>Property</MemberType>
53 <ReturnType>System.Type</ReturnType>
56 <value>To be added.</value>
58 <attribution license="cc4" from="Microsoft" modified="false" />
59 <para>The <see cref="P:System.Windows.Forms.ConvertEventArgs.DesiredType" /> property enables you to check the type of the property that the value is being converted to.</para>
62 <attribution license="cc4" from="Microsoft" modified="false" />
63 <para>Gets the data type of the desired value.</para>
67 <AssemblyVersion>1.0.5000.0</AssemblyVersion>
68 <AssemblyVersion>2.0.0.0</AssemblyVersion>
71 <Member MemberName="Value">
72 <MemberSignature Language="C#" Value="public object Value { set; get; }" />
73 <MemberType>Property</MemberType>
75 <ReturnType>System.Object</ReturnType>
78 <value>To be added.</value>
80 <attribution license="cc4" from="Microsoft" modified="false" />
81 <para>The value contained by the <see cref="P:System.Windows.Forms.ConvertEventArgs.Value" /> property depends on the event in which the <see cref="T:System.Windows.Forms.ConvertEventArgs" /> is returned. The <see cref="T:System.Windows.Forms.ConvertEventArgs" /> can be returned in either the <see cref="E:System.Windows.Forms.Binding.Format" /> event or the <see cref="E:System.Windows.Forms.Binding.Parse" /> event.</para>
82 <para>When the <see cref="T:System.Windows.Forms.ConvertEventArgs" /> is returned in the <see cref="E:System.Windows.Forms.Binding.Format" /> event, the <see cref="P:System.Windows.Forms.ConvertEventArgs.Value" /> property contains the unformatted property value of the data source. Within the <see cref="E:System.Windows.Forms.Binding.Format" /> event, you can read the property value, format the value, and reset the <see cref="P:System.Windows.Forms.ConvertEventArgs.Value" /> property to the new (formatted) value, thereby setting the value displayed in the data-bound control.</para>
83 <para>When the <see cref="T:System.Windows.Forms.ConvertEventArgs" /> is returned in the <see cref="E:System.Windows.Forms.Binding.Parse" /> event, the property contains the custom-formatted value of the data-bound control. Within the <see cref="E:System.Windows.Forms.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 <see cref="P:System.Windows.Forms.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 <see cref="P:System.Windows.Forms.ConvertEventArgs.DesiredType" /> property value.</para>
86 <attribution license="cc4" from="Microsoft" modified="false" />
87 <para>Gets or sets the value of the <see cref="T:System.Windows.Forms.ConvertEventArgs" />.</para>
91 <AssemblyVersion>1.0.5000.0</AssemblyVersion>
92 <AssemblyVersion>2.0.0.0</AssemblyVersion>