Hi Everyone,
I'm doing a school project and I don't seem to be able to link my 16 checkboxes to all display a different picture in a picture box.
Currently I have this code in all checkboxes (with few details different)
---------------------------------------------------------------------------------------
Private Sub chkGarden_CheckedChanged(sender As Object, e As EventArgs) Handles chkGarden.CheckedChanged
picDisplay.Image = New Bitmap("I:\Resources\PicBox\Garden Cleaning- PicBox.png")
shrink(sender) ' Calls the function below shrink(sender), this single line of code is used instead of the whole 'if' loop
End Sub
------------------------------------------------------------------------------------
I however get this error when I try to check a checkbox when debugging it.
---------------------------------------------------------------------------------
A first chance exception of type 'System.ArgumentException' occurred in System.Drawing.dll
Additional information: Parameter is not valid.
If there is a handler for this exception, the program may be safely continued.
--------------------------------------------------------------------------------
Anyone help please?
What I have tried:
Private Sub chkGarden_CheckedChanged(sender As Object, e As EventArgs) Handles chkGarden.CheckedChanged
picDisplay.Image = New Bitmap("I:\Resources\PicBox\Garden Cleaning- PicBox.png")
shrink(sender) ' Calls the function below shrink(sender), this single line of code is used instead of the whole 'if' loop
End Sub