I just put a picturebox, a label and a command button on a Form. In the click event of the command button I call the above procedure and it works just fine.