Quote Originally Posted by gwboolean View Post
I noticed that in the form where I had set the databinding properties for a textbox control in the properties window the date did not need to have any further formatting properties set to be correct. I was unable to find the .formattingEnabled and the .FormatString properties anywhere in the properties window. Where would these be found and why are they automatically set when the databinding properties are set using the properties window?
Select your control in the designer, open the Properties window, expand the (DataBindings) node, select the Advanced item and click the button with the ellipsis (...). That's where you configure the Binding object that is generated via the designer. You don't set the properties directly necessarily. For instance, if 'Format type' is set to 'No Formatting' then 'FormattingEnabled will be False, otherwise it will be True. If you select 'Date Time', then you get to select the FormatString via example. I just did that with a TextBox bound to a DateOfBirth column and I got this in the designer code file:
vb.net Code:
  1. Me.TextBox1.DataBindings.Add(New System.Windows.Forms.Binding("Text", Me.PersonBindingSource, "DateOfBirth", True, System.Windows.Forms.DataSourceUpdateMode.OnValidation, Nothing, "d"))
Note that that sets FormattingEnabled and FormatString via the Binding constructor, using the fourth and seventh parameters respectively.

Note that, if you want to open the designer code file, you'll need to click the 'Show All Files' button in the Solution Explorer first and expand the node for your form.