0
I am creating a powershell tool that performs a specific migration of program data. One step I need to perform is to check whether SQL server can write to the specified file locations. I have a button that is used to check access rights on the paths. If the user does not have the required access rights, a small picturebox (with a warning image) is placed next to the filepath. Likewise, if the user has access rights, a small picturebox (with a success checkmark) is placed next to the filepath.
Suppose the user fixes the filepaths that do not have access rights and they wish to rerun the access right checker. I want the previous pictureboxes to be removed and the form refreshed so that I do not display a warning image or success image until the checker is run again.
My issue is that after running the access right check, the pictureboxes do not get removed and the form does not get refreshed. If the filepath has changed and now has access rights, the old picturebox (with the warning icon) is still displayed which is incorrect.
I figured something along the lines of:
$form.controls.Remove($pictureBox3)
$form.controls.refresh()
would remove the pictureboxes but that does not seem to be the case. Is there something I am overlooking?
Everything you said was correct. The issue seemed to be how I was building the picturebox. I declared everything about the picturebox separately from adding the picturebox and it seemed to work. Thanks. – AKISH – 2014-12-10T18:01:39.390