Click here to Skip to main content
15,881,715 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
*1) estoy tratando de crear un "listbox" que se alimente por datos entrados de 3 "textbox" pero al presionar el boton no sale ningun resultado en el "listbox", y me da el siguiente error:

*1) Google Translated:
I am trying to create a "listbox" that is fed by data entered from 3 "textbox" but when I press the button, no results appear in the "listbox", and I get the following error:


BC30188 Visual Basic Declaration expected.

VB
Public Class Form1
    Private i As Object

    Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
        'Declarar variable
        Dim contador(i) As Integer
        Dim Valinicial, ValFinal, ValRepetir As Integer
        'Iniciar variables
        Valinicial = dato1.Text
        ValFinal = dato3.Text
        ValRepetir = dato2.Text

        For i = Valinicial To CInt(ValFinal) Step ValRepetir
            i = dato1.Text * dato3.Text

        Next
        For i = Valinicial To ValFinal

        Next
    End Sub
        resultado.Items.Add(contador(i))
End Class


Espero me puedan ayudar
Att Jose

What I have tried:

*2) he creado diversas variables y hasta utilice "CInt"

*2) Google translated
I have created several variables and even use "CInt"
Posted
Updated 20-Nov-18 10:33am
v2
Comments
Richard MacCutchan 20-Nov-18 15:42pm    
This is an English language site, please translate your question.
RedDk 20-Nov-18 15:45pm    
Perhaps "CInt" has not been declared (Dim) as type integer?

Dim CInt As Integer (add it to contador(i) As Integer) to make a list.

[EDIT}
You know, when you edit a post to conform to something a qa answerer says, you make it difficult for anyone with postential HELP to follow you; unless you use something like what I'm using here in this comment -> an "[EDIT]" message addition mark. You could also use the REPLY widget to respond directly to .. whoever. Just a heads-up for future readability.
[END EDIT]

1 solution

Ha declarado i como un objeto al principio de la clase, y luego está utilizando i una vez más como el iterador de un bucle for-next

(You have declared i as an object early in the class, and then you are using i once again as the iterator of a for-next loop)


VB
Public Class Form1
  Private i As Object

  Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
    'irrelevant code
    For i = Valinicial To CInt(ValFinal) Step ValRepetir
      i = dato1.Text * dato3.Text
    Next
 
Share this answer
 
Comments
[no name] 20-Nov-18 16:33pm    
+5

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900