• Log in or sign up for an account here: https://www.sythe.org/login

Help! :o

Syko_Chicken

Apprentice
Joined
Jan 21, 2007
Sythe Gold
0
Messages
709
Location
Perth, Western Australia
Help! :o
Hey,

I've just started learning Visual Basic 6 and tried following a tutorial to make a basic paint like program but came up with some syntax errors

Code:
Private Sub Form_Load()
[color=RED]DrawBitmap = New Bitmap(PictureBox1.Width, PictureBox1.Height)[/color]
DrawGraphics = Graphics.FromImage(DrawBitmap)
PictureBox1.Image = DrawBitmap
End Sub

Private Sub Picture1_Click()
Private DrawBitmap As Bitmap
Private DrawGraphics As Graphics
End Sub

Private Sub Picture1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
    If e.Button = Windows.Forms.MouseButtons.Left Then
      [color=RED]DrawGraphics.FillEllipse(Brushes.Blue, e.X, e.Y, 8, 8)[/color]
      PictureBox1.Image = DrawBitmap
    End If
End Sub

If anyone who has any decent knowledge in VB can help me well <3 ;) Also I have put the picture box as the tutorial said. :\
 
Help! :o
Did you declare all your variables in there?
 
Help! :o
Code:
Private DrawBitmap As Bitmap
Private DrawGraphics As Graphics

Private Sub Form_Load()
DrawBitmap = New Bitmap(PictureBox1.Width, PictureBox1.Height)
DrawGraphics = Graphics.FromImage(DrawBitmap)
PictureBox1.Image = DrawBitmap
End Sub

Private Sub Picture1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
    If e.Button = Windows.Forms.MouseButtons.Left Then
      DrawGraphics.FillEllipse(Brushes.Blue, e.X, e.Y, 8, 8)
      PictureBox1.Image = DrawBitmap
    End If
End Sub
 
Runescape Gamblingrunescape gambling
Back
Top