alina.nazchowdhury 0 Newbie Poster

I get lots of error in my program like: Warning 1 WithEvents variable 'Close' conflicts with sub 'Close' in the base class 'Form' and should be declared 'Shadows'. C:\Documents and Settings\Alina\My Documents\Visual Studio 2008\Projects\WindowsApplication1\WindowsApplication1\Form1.Designer.vb 321 23 WindowsApplication1
Error 2 Expression is not a method. C:\Documents and Settings\Alina\My Documents\Visual Studio 2008\Projects\WindowsApplication1\WindowsApplication1\Form1.vb 63 9 WindowsApplication1
Error 3 Property access must assign to the property or use its value. C:\Documents and Settings\Alina\My Documents\Visual Studio 2008\Projects\WindowsApplication1\WindowsApplication1\Form1.vb 141 9 WindowsApplication1
Please somebody help me, i can not understand why.
Here is the code:

Public Class Picture_Viewer

  Public ImageNum As Integer


Private Sub opt_image1_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles opt_image1.CheckedChanged
    mypic.Image = My.Resources.img1
End Sub

Private Sub opt_image2_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles opt_image2.CheckedChanged
    mypic.Image = My.Resources.img2
End Sub

Private Sub opt_image3_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles opt_image3.CheckedChanged
    mypic.Image = My.Resources.img3
End Sub

Private Sub opt_image4_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles opt_image4.CheckedChanged
    mypic.Image = My.Resources.img4
End Sub

Private Sub opt_image5_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles opt_image5.CheckedChanged
    mypic.Image = My.Resources.img5
End Sub
Private Sub opt_image6_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles opt_image6.CheckedChanged
    mypic.Image = My.Resources.img6
End Sub
Private Sub opt_image7_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs)
    mypic.Image = My.Resources.img7
End Sub

Private Sub opt_image8_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles opt_image8.CheckedChanged
    mypic.Image = My.Resources.img8
End Sub

Private Sub opt_image9_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles opt_image9.CheckedChanged
    mypic.Image = My.Resources.img9
End Sub

Private Sub Picture_Viewer_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
    mypic.Image = My.Resources.img3
    opt_image3.Checked = True
End Sub

Private Sub Clear_picture_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Clear_picture.Click
    mypic.Image = Nothing
End Sub

Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
    If (ColorDialog1.ShowDialog() = DialogResult.OK) Then
        Me.BackColor = ColorDialog1.Color
    End If

End Sub


Private Sub Back_color_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Back_color.Click
    If (ColorDialog1.ShowDialog() = DialogResult.OK) Then
        mypic.BackColor = ColorDialog1.Color
    End If

End Sub

Private Sub Previous_pic_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Previous_pic.Click
    ImageNum(-1)
    If ImageNum < 1 Then ImageNum = 9 ' decreases the numbers

    Select Case ImageNum
        Case 1
            mypic.Image = My.Resources.img1
            opt_image1.Checked = True
        Case 2
            mypic.Image = My.Resources.img2
            opt_image2.Checked = True
        Case 3
            mypic.Image = My.Resources.img3
            opt_image3.Checked = True
        Case 4
            mypic.Image = My.Resources.img4
            opt_image4.Checked = True
        Case 5
            mypic.Image = My.Resources.img5
            opt_image5.Checked = True
        Case 6
            mypic.Image = My.Resources.img6
            opt_image6.Checked = True
        Case 7
            mypic.Image = My.Resources.img7
            opt_image7.Checked = True
        Case 8
            mypic.Image = My.Resources.img8
            opt_image8.Checked = True
        Case 9
            mypic.Image = My.Resources.img9
            opt_image9.Checked = True
    End Select
End Sub

Private Sub Next_pic_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Next_pic.Click
    ImageNum(+1)
    If ImageNum > 1 Then ImageNum = 9 ' increases the numbers

    Select Case ImageNum
        Case 1
            mypic.Image = My.Resources.img1
            opt_image1.Checked = True
        Case 2
            mypic.Image = My.Resources.img2
            opt_image2.Checked = True
        Case 3
            mypic.Image = My.Resources.img3
            opt_image3.Checked = True
        Case 4
            mypic.Image = My.Resources.img4
            opt_image4.Checked = True
        Case 5
            mypic.Image = My.Resources.img5
            opt_image5.Checked = True
        Case 6
            mypic.Image = My.Resources.img6
            opt_image6.Checked = True
        Case 7
            mypic.Image = My.Resources.img7
            opt_image7.Checked = True
        Case 8
            mypic.Image = My.Resources.img8
            opt_image8.Checked = True
        Case 9
            mypic.Image = My.Resources.img9
            opt_image9.Checked = True
    End Select
End Sub


Private Sub Select_image_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Select_image.Click
    If (OpenFileDialog1.ShowDialog() = DialogResult.OK) Then

        mypic.Load(OpenFileDialog1.FileName)
    End If
End Sub

Private Sub Close_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Close.Click
    Close()
End Sub


Private Sub Stretch_image_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles chk_slide_show.CheckedChanged
    If (chk_slide_show.Checked) Then
        mypic.SizeMode = PictureBoxSizeMode.StretchImage
    Else
        mypic.SizeMode = PictureBoxSizeMode.Normal
    End If
End Sub


Private Sub Slide_show_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Slide_show.CheckedChanged
    If Slide_show.Checked = True Then
        Timer1.Enabled = True
    Else
        Timer1.Enabled = False
    End If
End Sub

Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
    Call Next_pic_Click(sender, e)
End Sub

End Class