
Ahorcado Visual Basic
Publicado por Anthony (2 intervenciones) el 06/01/2015 10:04:31
Buenas noche amigos(as) estoy realizando el juego del ahorcado en visual basic y al ejecutar el programa cuando voy a escribir en el text me dice "error de compilador el numero de argumentos erróneos o asignación de propiedad no invalida" y me resalta Private Sub Text1_KeyPress(KeyAscii As Integer) en amarillo que indica que esta la falla he revisado esa parte pero no se donde puede estar el problema y quisiera que por favor me ayudaran a resolverlo lo mas pronto posible de ante mano muchas gracias por toda la ayuda que me puedan brindar aquí les dejo la estructura..
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
Dim j As Byte
Dim n As Integer
Dim espacio As Integer
Dim partes As Byte
Dim error As Byte
Dim gano As Byte
Private Sub Form_Load()
Label4.Visible = False
Line12.Visible = False
Label2.Enabled = False
partes = 1
letrasm
End Sub
Private Sub Label2_Click()
For j = 1 To n - 1
Unload Label4(j)
Unload Line12(j)
Label4.Visible = False
Line12.Visible = False
Next j
espacio = 0
Text1.Text = ""
Text1.Enabled = True
Text1.Visible = True
Text1.SetFocus
Label2.Enabled = False
gano = 0
partes = 1
letrasm
borrar
End Sub
Private Sub Command1_Click(Index As Integer)
For j = 0 To n - 1
If Command1(Index).Caption = Label4(j).Caption Then
Label4(j).Visible = True
error = 1
gano = gano + 1
Command1(Index).Enabled = False
End If
Next j
If gano = n Then
MsgBox " FELICITACIONES HAS GANADO "
Label2_Click
'partes = 1
End If
If error = 0 Then
muneco
End If
error = 0
End Sub
Private Sub Text1_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
If Text1.Text = "" Then Exit Sub
Text1.Enabled = False
Label4.Visible = True
Line12.Visible = True
n = Len(Text1.Text)
For j = 1 To n - 1
espacio = espacio + 700
Load Label4(j)
Load Line12(j)
Label4(j).Visible = True
Line12(j).Visible = True
Label4(j).Left = Label4(j).Left + espacio
Line12(j).X1 = Line12.X1 + espacio
Line12(j).X2 = Line12(j).X2 + espacio
Next j
For j = 1 To n
Label4(j - 1).Visible = False
Label4(j - 1).Caption = Mid(Text1.Text, j, 1)
Next j
Label3.Caption = "La Palabra Indicada Tiene " & n & " letras"
Text1.Visible = False
Label2.Enabled = True
letras
End If
End Sub
Sub muneco()
Select Case partes
Case 1
Line6.Visible = True
Case 2
Line7.Visible = True
Case 3
Line8.Visible = True
Case 4
Line9.Visible = True
Case 5
Line10.Visible = True
Case 6
Line11.Visible = True
Case 7
Shape1.Visible = True
MsgBox " PERDISTE SIGUE INTENTANDO SUERTE "
Label2_Click
End Select
partes = partes + 1
End Sub
Sub borrar()
Line6.Visible = False
Line7.Visible = False
Line8.Visible = False
Line9.Visible = False
Line10.Visible = False
Line11.Visible = False
Shape1.Visible = False
End Sub
Sub letrasm()
For j = 0 To 26
Command1(j).Enabled = False
Next j
End Sub
Sub letras()
For j = 0 To 26
Command1(j).Enabled = True
Next j
End Sub
Private Sub Command2_Click()
End
End Sub
Valora esta pregunta


0