Private Sub Command1_Click()
Frame1.Caption = Text1.Text
    Frame2.Caption = Text2.Text
    Text3.Text = ""
    Text4.Text = ""
End Sub

Private Sub Command2_Click()
Unload Me
End Sub

Private Sub Command3_Click(Index As Integer)
Text3.Text = Val(Text3.Text) + 1

End Sub

Private Sub Command4_Click(Index As Integer)
Text4.Text = Val(Text4.Text) + 1
End Sub


Public Sub Label1_Change()
If Text3.Text > Text4.Text Then
    Label1.Caption = "Player1 is leading!"
ElseIf Text4.Text > Text3.Text Then
    Label1.Caption = "Player2 is leading!"
ElseIf Text3.Text = Text4.Text Then
    Label1.Caption = "Tough game!"
End If
End Sub

whats wrong with this scoreboard?

Edited 5 Years Ago by Narue: Added code tags

When the event Label1_Change() fires, as you are not changing the Caption of the label1 any where other than the change event of itself.

Edited 5 Years Ago by debasisdas: n/a

When the event Label1_Change() fires, as you are not changing the Caption of the label1 any where other than the change event of itself.

-ty
-the error said there were some procedure/event having the same name., i dont get it./

Which line in your code is throwing error ?

Private Sub Command1_Click()
Frame1.Caption = Text1.Text
Frame2.Caption = Text2.Text
Text3.Text = ""
Text4.Text = ""
End Sub

Private Sub Command2_Click()
Unload Me
End Sub

[B]Private Sub Command3_Click(Index As Integer)[/B]
Text3.Text = Val(Text3.Text) + 1

End Sub

Private Sub Command4_Click(Index As Integer)
Text4.Text = Val(Text4.Text) + 1
End Sub


Public Sub Label1_Change()
If Text3.Text > Text4.Text Then
Label1.Caption = "Player1 is leading!"
ElseIf Text4.Text > Text3.Text Then
Label1.Caption = "Player2 is leading!"
ElseIf Text3.Text = Text4.Text Then
Label1.Caption = "Tough game!"
End If
End Sub

Edited 5 Years Ago by __avd: Added [code] tags.

Have you created a control array ?

i don't know what a control array means.,,i'm just tryin whta i know to be advance,. i didn't know this cou'ld be that uneasy,.ty

Why click event of Command 3 and 4 shows (Index As Integer) ,while command 1 and 2 does not. That means you are using control arrays unknowingly.

Did you copied an pasted command buttons on your form ?

Why click event of Command 3 and 4 shows (Index As Integer) ,while command 1 and 2 does not. That means you are using control arrays unknowingly.

Did you copied an pasted command buttons on your form ?

-i did not., i just typed it the usual way.,ty

Attachments a1.jpg 54.19 KB

As i have already mention your code shows you are using control array of command buttons.

If you do not want to accept your mistake and do not want to learn anything, God bless you.

Comments
:)

As i have already mention your code shows you are using control array of command buttons.

If you do not want to accept your mistake and do not want to learn anything, God bless you.

im sorry.,
i didn't copy pasted anything.,i just didn't realized there was control array

Remove the Index As Integer in line 12 and 17 like this;

Private Sub Command3_Click()

and this,

Private Sub Command4_Click()

respectively, and it shall set you free ;)

and debasisdas is right to remove the accidental array, do the following;
1. click on Command 3button in the properties window goto index and delete anything found therein (so that is becomes empty)
2. do the same for Command 4.

Edited 5 Years Ago by faroukmuhammad: n/a

i just didn't realized there was control array

That is what i was trying to explain you from last 2 days.

That is what i was trying to explain you from last 2 days.

now i am enlightened! ty2 : )

now i am enlightened! ty2 : )

Private Sub Command1_Click()
MsgBox "haha!! duh!"
Unload Me
End Sub
Private Sub Form_Load()
Me.Top = (Screen.Height - Me.Height) / 2
Me.Left = (Screen.Width - Me.Width) / 2
End Sub
Private Sub Text1_Change()

If Text1.Text = "1" Then
MsgBox "Bingo!", vbInformation, "success"
Form2.Show
Unload Me
Else
MsgBox "Try again...Your time is fucking off!", vbCritical, "Wrong"
Text1.Text = " "
End If
End Sub
Private Sub Timer1_Timer()
Dim count, ihap As Integer
count = Val(Label2.Caption)
ihap = 5
If count <> ihap Then
count = count + 1
Label2.Caption = count
Else
MsgBox "Your time is fucked up!"
Unload Me
End If
End Sub


i'm really a sucker at this

Attachments 1x.jpg 55.09 KB
This article has been dead for over six months. Start a new discussion instead.