Each checkbox is then added to a FlowLayoutPanel control.
Then when I select the CheckBox control that is in a FlowLayoutPanel control and resize the image and try to write it again with the new Width and Height using the same filetarget, I get a Permission Denied exception. The cause is the code above, because the CheckBox object with the Image somehow prevents the same file to be written again.
Code: Select all
myCheckBox.Image = Image.FromFile(filetarget);
Does anyone know a fix for this?