There isn't much to explain. I have this buttonThen in a combobox event I call this sub and I try to set it enabled or disabledCode:<Button x:Name="btnAdd" Content="Add" Grid.Row="1" Grid.Column="2" IsEnabled="False"/>
When I open the form it immediately says an object is not set to an instance of an object. If I comment out the isenabled lines it loads fineCode:Private Sub EnableAdd() If loading = False Then If tbxName.Text <> "" And tbxServing.Text <> "" Then btnAdd.IsEnabled = True Else btnAdd.IsEnabled = False End If End If End Sub




Reply With Quote