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
Post a Comment