Quote Originally Posted by Heiningba View Post
lol how to run this code? i copied and pasted it on a new form and changes class name to whatever it is, does not work
While calling functions it is not working
Create a new project. Add a new PictureBox and a button into your form. And use this code:
vb.net Code:
  1. Public Class Form1
  2.  
  3.     Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
  4.  
  5.         '~~~ Create the object
  6.         Dim myCaptcha As New captcha
  7.  
  8.         '~~~ Generate the captcha image and assign this image to the picturebox
  9.         PictureBox1.Image = myCaptcha.generatecaptcha(5)
  10.  
  11.     End Sub
  12.  
  13.     Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
  14.  
  15.         PictureBox1.SizeMode = PictureBoxSizeMode.AutoSize  '~~~ or, you can drag the picturebox to a bigger size(at design time) that could afford the image generated
  16.         Me.WindowState = FormWindowState.Maximized  '~~~ show the form as maximized
  17.  
  18.     End Sub
  19.  
  20. End Class
Then add a new class(Project menu --> Add new class).
And copy-paste the code from the first post of this thread.

Then run your project.