Private Sub RemoveBinding(ByVal ControlToRefresh As Control, ByVal PropertyName As String) '-- Establish locals Dim loPropInfo As PropertyInfo '-- Check to see if the bindings have already been removed If ControlToRefresh.DataBindings.Count > 0 Then '-- If there are data bindings, but no data, then clear the data bindings to prevent errors ControlToRefresh.DataBindings.Clear() '-- Set the property value Dim combo As System.Windows.Forms.ComboBox = TryCast(ControlToRefresh, System.Windows.Forms.ComboBox) If combo IsNot Nothing Then '-- We need to clear the combo box '-- First try to set the text on the combo box combo.Text = String.Empty '-- If the text could not be set, then either clear the selected value or set to the top index if it has a data source If Not String.IsNullOrEmpty(combo.Text) Then If combo.DataSource Is Nothing Then '-- Clear the selected value combo.SelectedValue = Nothing ElseIf combo.Items.Count > 0 Then '-- Set to the top index combo.SelectedIndex = 0 End If End If Else '-- Get the property info loPropInfo = TypePropertyCache.GetPropertyInfo(ControlToRefresh.GetType(), PropertyName) '-- Clear out the value loPropInfo.SetValue(ControlToRefresh, GetSystemTypeDefaultValue(loPropInfo.PropertyType), Nothing) End If End If End Sub