heres the project click change pic type something in the backspace it all and the button will still be enabled here btw it's vb.net
@stevemk14ebr, changes below make it work, seems most of the glitch was caused by the ElseIf statement before: Code: Public Sub disablecheck() 'if the textbox has nothing in it and the picturebox has nothing in it then disable button If TextBox1.Text = String.Empty And PictureBox1.Image Is Nothing Then Button1.Enabled = False 'else if textbox length is longer than 0 characters and picturebox1.image is something then enable 'when the textbox is filled and then all characters backspaced this check fails, i don't know why because this checks for all possible characters? ElseIf Not String.IsNullOrWhiteSpace(TextBox1.Text.Trim) And Not PictureBox1.Image Is Nothing Then Button1.Enabled = True End If End Sub after: Code: Public Sub disablecheck() 'if the textbox has nothing in it and the picturebox has nothing in it then disable button If String.IsNullOrWhiteSpace(TextBox1.Text.Trim) And PictureBox1.Image Is Nothing Then Button1.Enabled = False Else Button1.Enabled = True End If End Sub
ok your not going to believe this but my "and" operator is acting like and "or" and the "or" like an "and". so when i use the code Code: If (String.IsNullOrWhiteSpace(TextBox1.Text.Trim)) Or (PictureBox1.Image Is Nothing) Then Button1.Enabled = False Else Button1.Enabled = True End If it works as you would expect if there were an "and" operator in there-instead of the or that is currently there but when i use the code Code: If (String.IsNullOrWhiteSpace(TextBox1.Text.Trim)) and (PictureBox1.Image Is Nothing) Then Button1.Enabled = False Else Button1.Enabled = True End If it works like you would expect and or operator to do- except with an and operator in is there a setting that could do this in vb express 2010 or is just a glitch/bug