En VB, sólo sé el nombre del control. ¿Cómo puedo obtener el objeto?
Copiado directamente el código en el documento txt, luego modificó el archivo frm a vb y lo ejecutó directamente en vb.
¡Olvídalo, déjame copiarlo para ti!
'------------------------------------------ --- ----------------------------------
'Guardar lo siguiente como archivo con la extensión frm,
'Por ejemplo, guárdelo como frmMain.frm,
'Luego ábralo en VB6 y compílelo.
' - -------------------------------------------------- ------------------------------
VERSIÓN 5.00
Comenzar VB.frmMain
Caption = "Matriz de prueba"
ClientHeight = 4470
ClientLeft = 60
ClientTop = 345
ClientWidth = 6750
ScaleHeight = 4470
ScaleWidth = 6750
StartUpPosition = 2 'Centro de pantalla
Comenzar VB.CommandButton cmdExit p>
Título = "Salir(amp;X)"
Alto = 495
Izquierda = 5400
TabIndex = 3
Arriba = 3960
Ancho = 1215
Fin
Inicio VB.NET TextBox txtOutput = "Salir (amp; X)"
Iniciar.
Izquierda = 0
TabIndex = 1
Arriba = 720
Ancho = 6735
Fin
Inicio VB .>
Izquierda = 120
TabIndex = 0
Superior = 240
Ancho = 1215
Fin
Fin
Atributo VB_Name = "frmMain"
AtributoVB_GlobalNameSpace = False
Atributo VB_Creatable = False
Atributo VB_PredeclaredId = True
Atributo VB_Exposed = False
'--------------------- - -------------------------------------------------- -
<'
' Proyecto: Obtenga la matriz e ingrésela en el cuadro de texto
' ' Creado por: Anbert
' Fecha-hora: 2006-10-30 10:23:59
<'
'-------------------- ------ ---------------------------------------- ---- ------ ---------
Opción explícita
Dim Arr As Variant 'Matriz para guardar datos de entrada (el entorno actual es un número largo)
Dim Index As Integer 'El índice actual de la matriz
Dim txtOut As String genera la cadena mostrada
'Salir del programa
Private Sub cmdExit_Click()
Descargarme
End Sub
'Mostrar los datos en la matriz
Private Sub cmdShow_Click()
Dim L como entero, U como entero
Dim i como entero
L = LBound(Arr) 'Subíndice de matriz
U = UBound(Arr) 'Superíndice de matriz
txtOutput = txtOutput vbCrLf vbCrLf
'Longitud de matriz
txtOutput = txtOutput "Len(Array)=" CStr(U - L 1) vbCrLfL 1) vbCrLf
'Contenido de la matriz de bucle
For i = L To U
txtOutput = txtOutput "Array(" CStr(i) ")=" CStr(Arr( i)) vbTab
Siguiente
cmdShow.Enabled = False
txtInput.Enabled = True