Visual Basic - Problema con un codigo de Visual Basic

Life is soft - evento anual de software empresarial
 
Vista:
sin imagen de perfil

Problema con un codigo de Visual Basic

Publicado por jonatan (1 intervención) el 15/06/2014 23:28:35
Este es el codigo pero a la hora de ejecutarlo me da error y no entiendo porque haber si me pueden ayudar.
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
Rem Definici{on de las variables
Public maxcolumna, maxfila, color As Integer
Public coll, col2, fil1, fil2 As Integer
Sub lineas()
maxcolumna = Picture2.ScaleWidth
maxfila = Picture2.ScaleHeight
Col1 = Int((maxcolumna - 1 + 1) * Rnd + 1)
fil1 = Int((maxfila - 1 + 1) * Rnd + 1)
col2 = Int((maxcolumna - 1 + 1) * Rnd + 1)
fil2 = Int((maxfila - 1 + 1) * Rnd + 1)
color = Int((14 - 1 + 1) * Rnd + 1)
Picture2.ForeColor = QBColor(color)
Picture2.Line (Col1, fil1)-(col2, fil2)
End Sub
Private Sub Timer1_Timer()
circulos
lineas
rectagulos
End Sub
Private Sub Form_Load()
Ramdomize
Timer1.Interval = 100
End Sub
Sub circulos()
    Dim columna, fila, margader, margsup, margderm As Integer
    Dim margsupm, maxradioder, maxradiosup, radio As Integer
    maxcolumna = Picture.Width
    maxfila = Picture1.ScaleHeight
    columna = Int((mazcolumna - 1 + 1) * Rnd + 1)
    fila = Int((maxfila - 1 + 1) * Rnd + 1)
    margader = Picture.Width 'maximo ancho
    margsup = Picture1.ScaleHeight 'maxima altura
    Rem obtiene el punto central del control picture
    margderm = Picture1.ScaleWidth / 2
    margsupm = Picture1.ScaleHeight / 2
    color = Int((14 - 1 + 1) * Rnd + 1) 'Color al azar
    If columna > margderm Then
        maxradioder = margder - columna
    Else
        maxradioder = columna
    End If
    If fila > nargsupm Then
        maxradiosup = margsup - fila
    Else
        maxradiosup = fila
    End If
    If maxradioder > maxradiosup Then
        radio = maxradiosup
    Else
        radio = maxradioder
    End If
    Picture1.ForeColor = QBColor(color)
    Picture.Circle (columna, fila), radio
        If (Int(Timer) Mod 10) = 0 Then
        Picture1.Cls
        Picture2.Cls
        Picture3.Cls
        Randomize
    End If
End Sub
Sub rectangulos()
    maxcolumna = Picture3.ScaleWidth
    maxfila = Picture3.ScaleHeight
    Col1 = Int((maxcolumna - 1 + 1) * Rnd + 1)
    fil1 = Int((maxfila - 1 + 1) * Rnd + 1)
    col2 = Int((maxcolumna - 1 + 1) * Rnd + 1)
    fil2 = Int((maxfila - 1 + 1) * Rnd + 1)
    color = Int((14 - 1 + 1) * Rnd + 1)
    Picture3.ForeColor = QBColor(color)
    Picture3.Line (Col1, fil1)-(col2, fila2), , B
End Sub

Haber si me pueden ayudar.
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder

Problema con un codigo de Visual Basic

Publicado por jcmg (24 intervenciones) el 16/06/2014 05:04:05
Aqui esta el codigo reparado:
tenia tres errores:
Dios te bendiga

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
Rem Definici{on de las variables
Public maxcolumna, maxfila, color As Integer
Public coll, col2, fil1, fil2 As Integer
Sub lineas()
maxcolumna = Picture2.ScaleWidth
maxfila = Picture2.ScaleHeight
Col1 = Int((maxcolumna - 1 + 1) * Rnd + 1)
fil1 = Int((maxfila - 1 + 1) * Rnd + 1)
col2 = Int((maxcolumna - 1 + 1) * Rnd + 1)
fil2 = Int((maxfila - 1 + 1) * Rnd + 1)
color = Int((14 - 1 + 1) * Rnd + 1)
Picture2.ForeColor = QBColor(color)
Picture2.Line (Col1, fil1)-(col2, fil2)
End Sub
Private Sub Timer1_Timer()
circulos
lineas
rectangulos                      'Es rectangulos no rectagulos
End Sub
Private Sub Form_Load()
Randomize                        'Es Randomize no ramdomize
Timer1.Interval = 100
End Sub
Sub circulos()
Dim columna, fila, margader, margsup, margderm As Integer
Dim margsupm, maxradioder, maxradiosup, radio As Integer
maxcolumna = Picture.Width
maxfila = Picture1.ScaleHeight
columna = Int((mazcolumna - 1 + 1) * Rnd + 1)
fila = Int((maxfila - 1 + 1) * Rnd + 1)
margader = Picture.Width 'maximo ancho
margsup = Picture1.ScaleHeight 'maxima altura
Rem obtiene el punto central del control picture
margderm = Picture1.ScaleWidth / 2
margsupm = Picture1.ScaleHeight / 2
color = Int((14 - 1 + 1) * Rnd + 1) 'Color al azar
If columna > margderm Then
maxradioder = margder - columna
Else
maxradioder = columna
End If
If fila > nargsupm Then
maxradiosup = margsup - fila
Else
maxradiosup = fila
End If
If maxradioder > maxradiosup Then
radio = maxradiosup
Else
radio = maxradioder
End If
Picture1.ForeColor = QBColor(color)
Picture1.Circle (columna, fila), radio   'Es Picture1.circle no Picture.circle
If (Int(Timer) Mod 10) = 0 Then
Picture1.Cls
Picture2.Cls
Picture3.Cls
Randomize
End If
End Sub
Sub rectangulos()
maxcolumna = Picture3.ScaleWidth
maxfila = Picture3.ScaleHeight
Col1 = Int((maxcolumna - 1 + 1) * Rnd + 1)
fil1 = Int((maxfila - 1 + 1) * Rnd + 1)
col2 = Int((maxcolumna - 1 + 1) * Rnd + 1)
fil2 = Int((maxfila - 1 + 1) * Rnd + 1)
color = Int((14 - 1 + 1) * Rnd + 1)
Picture3.ForeColor = QBColor(color)
Picture3.Line (Col1, fil1)-(col2, fila2), , B
End Sub
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar