3 Replies - 178 Views - Last Post: 05 December 2011 - 02:52 AM Rate Topic: -----

#1 Zafeer.H  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 10
  • Joined: 04-December 11

Identifier expecter error

Posted 05 December 2011 - 02:14 AM

 Public Class Form1

    Private Sub PictureBox7_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles PictureBox7.Click

    End Sub

    Private Sub ShowDigit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ShowDigit.Click
        Dim Digit1 As Integer = DigitValue.Text
        If Digit1 = 0 Then
            PictureBox1.Visible = True
            PictureBox2.Visible = True
            PictureBox3.Visible = True
            PictureBox5.Visible = True
            PictureBox6.Visible = True
            PictureBox7.Visible = True
            PictureBox4.Visible = False
        End If
        If Digit1 = 1 Then
            PictureBox1.Visible = True
            PictureBox2.Visible = True
            PictureBox3.Visible = True
            PictureBox5.Visible = True
            PictureBox6.Visible = True
            PictureBox7.Visible = True
            PictureBox4.Visible = False
        End If
        If Digit1 = 2 Then
            PictureBox1.Visible = True
            PictureBox2.Visible = True
            PictureBox3.Visible = True
            PictureBox5.Visible = True
            PictureBox6.Visible = True
            PictureBox7.Visible = True
            PictureBox4.Visible = False
        End If
        If Digit1 = 3 Then
            PictureBox1.Visible = True
            PictureBox2.Visible = True
            PictureBox3.Visible = True
            PictureBox5.Visible = True
            PictureBox6.Visible = True
            PictureBox7.Visible = True
            PictureBox4.Visible = False
        End If

        If Digit1 = 4 Then
            PictureBox1.Visible = True
            PictureBox2.Visible = True
            PictureBox3.Visible = True
            PictureBox5.Visible = True
            PictureBox6.Visible = True
            PictureBox7.Visible = True
            PictureBox4.Visible = False
        End If
        If Digit1 = 5 Then
            PictureBox1.Visible = True
            PictureBox2.Visible = True
            PictureBox3.Visible = True
            PictureBox5.Visible = True
            PictureBox6.Visible = True
            PictureBox7.Visible = True
            PictureBox4.Visible = False
        End If
        If Digit1 = 6 Then
            PictureBox1.Visible = True
            PictureBox2.Visible = True
            PictureBox3.Visible = True
            PictureBox5.Visible = True
            PictureBox6.Visible = True
            PictureBox7.Visible = True
            PictureBox4.Visible = False
        End If
        If Digit1 = 7 Then
            PictureBox1.Visible = True
            PictureBox2.Visible = True
            PictureBox3.Visible = True
            PictureBox5.Visible = True
            PictureBox6.Visible = True
            PictureBox7.Visible = True
            PictureBox4.Visible = False
        End If
        DigitValue.Text = DigitValue.Text + 1
        OneSecs.Text = OneSecs.Text + 1
    End Sub

    Private Sub AddOne_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles AddOne.Click
        ShowDigit_Click(sender, e)
        If DigitValue.Text > 9 Then
            DigitValue.Text = "0"

        End If
    End Sub

    Private Sub ShowDigit2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ShowDigit2.Click
        Dim Digit As Integer = OneSecs.Text
        If Digit = 0 Then
            PictureBox8.Image = Image.FromFile("C:\Users\Zafeer Hussain\Desktop\0.jpg")
        End If

        If Digit = 1 Then
            PictureBox8.Image = Image.FromFile("C:\Users\Zafeer Hussain\Desktop\1.jpg")
        End If

        If Digit = 2 Then
            PictureBox8.Image = Image.FromFile("C:\Users\Zafeer Hussain\Desktop\2.jpg")
        End If
        If Digit = 3 Then
            PictureBox8.Image = Image.FromFile("C:\Users\Zafeer Hussain\Desktop\3.jpg")
        End If
        If Digit = 4 Then
            PictureBox8.Image = Image.FromFile("C:\Users\Zafeer Hussain\Desktop\4.jpg")
        End If
        If Digit = 5 Then
            PictureBox8.Image = Image.FromFile("C:\Users\Zafeer Hussain\Desktop\5.jpg")
        End If
        If Digit = 6 Then
            PictureBox8.Image = Image.FromFile("C:\Users\Zafeer Hussain\Desktop\6.jpg")
        End If
        If Digit = 7 Then
            PictureBox8.Image = Image.FromFile("C:\Users\Zafeer Hussain\Desktop\7.jpg")
        End If
        If Digit = 8 Then
            PictureBox8.Image = Image.FromFile("C:\Users\Zafeer Hussain\Desktop\8.jpg")
        End If
        If Digit = 9 Then
            PictureBox8.Image = Image.FromFile("C:\Users\Zafeer Hussain\Desktop\9.jpg")
        End If
    End Sub

    Private Sub OneSecs_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles OneSecs.TextChanged

    End Sub

    Private Sub ShowDigit3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ShowDigit3.Click
        Dim Digit As Integer = TenSecs.Text
        If Digit = 1 Then
            PictureBox. = ("H:\VBCode\DigitalTimer\1.jpg")
        End If
    End Sub
End Class 





Can anyone distinguish the problem I can't seem to?? :s

Also how would I finish off the code in ShowDigit3 so it shows the correct picture image for any number 0-9 in TenSecs??

Is This A Good Question/Topic? 0
  • +

Replies To: Identifier expecter error

#2 DimitriV  Icon User is offline

  • Don't try to save yourself… the circle is complete
  • member icon

Reputation: 544
  • View blog
  • Posts: 2,632
  • Joined: 24-July 11

Re: Identifier expecter error

Posted 05 December 2011 - 02:24 AM

You would do this:
PictureBox1.Image = Image.FromFile("H:\VBCode\DigitalTimer\1.jpg")

Replace PictureBox1 with the name of your PictureBox control :)
Was This Post Helpful? 1
  • +
  • -

#3 Zafeer.H  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 10
  • Joined: 04-December 11

Re: Identifier expecter error

Posted 05 December 2011 - 02:45 AM

Thank you again. Also how would I finish off the code in ShowDigit3 so it shows the correct picture image for any number 0-9 in TenSecs?
Was This Post Helpful? 0
  • +
  • -

#4 DimitriV  Icon User is offline

  • Don't try to save yourself… the circle is complete
  • member icon

Reputation: 544
  • View blog
  • Posts: 2,632
  • Joined: 24-July 11

Re: Identifier expecter error

Posted 05 December 2011 - 02:52 AM

View PostZafeer.H, on 05 December 2011 - 07:45 PM, said:

Thank you again. Also how would I finish off the code in ShowDigit3 so it shows the correct picture image for any number 0-9 in TenSecs?

Like you've got it, but repeat the if statement (hint: copy/paste!) and increment it by one.
 If Digit = 1 Then
            PictureBox.Image = Image.FromFile("H:\VBCode\DigitalTimer\1.jpg")
ElseIf Digit = 2 Then
'Set image
'Repeat the ElseIfs for each condition (1-9)
        End If


Was This Post Helpful? 0
  • +
  • -

Page 1 of 1