vb.net - Enable and disable command button when picture box is empty or filled -


i doing project on data add , update. below code enable command button if text fields filled , image uploaded file, command button enabling if image empty in picture box. please me enabling , disabling command button when image filled , emptied.

private sub txtfields_textchanged(sender object, e eventargs) handles txtpassword.textchanged     if not string.isnullorwhitespace(txtid.text) andalso not string.isnullorwhitespace(txtname.text) andalso not string.isnullorwhitespace(txtusername.text) andalso not string.isnullorwhitespace(txtpassword.text) andalso picuser.image nothing         btnadd.enabled = true     end if end sub 

you've written andalso picuser.image nothing then means that "if image nothing"

i suggest change part to:

andalso picuser.image nothing = false 

hope helps! :)


Comments

Popular posts from this blog

ubuntu - PHP script to find files of certain extensions in a directory, returns populated array when run in browser, but empty array when run from terminal -

php - How can i create a user dashboard -

javascript - How to detect toggling of the fullscreen-toolbar in jQuery Mobile? -