Visual Basic - como capturo

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

como capturo

Publicado por ALFREDO CANO (3 intervenciones) el 27/06/2002 20:44:09
Hola amigos, ojala alguien me pueda decir como hago para capturar datos en un objeto MSflexgrid 5 de visual basic, puede mostrar datos en el sin problemas, pero si quiero usarlo como captura, que debo hacer.

muchas gracias.
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

RE:como capturo

Publicado por Nelson Fredericksen (125 intervenciones) el 27/06/2002 21:07:40
Primero dibuja un MSflexGrid en un formulario, luego, sobre el MSFlexGrid conlo un cuadro de texto y colocas su propiedad BorderStyle = 0

Sub msflexgridedit(MSFlexGrid As Control, edt As Control, keyascii As Integer)
Select Case keyascii
Case 0 To 32
edt = MSFlexGrid
edt.SelStart = 1000
Case Else
edt = Chr(keyascii)
edt.SelStart = 1
End Select
edt.Move MSFlexGrid.CellLeft, MSFlexGrid.CellTop, _
MSFlexGrid.CellWidth, MSFlexGrid.CellHeight
edt.Visible = True
edt.SetFocus
End Sub
Private Sub fg2_DblClick()
msflexgridedit fg2, txtedit, 32
End Sub
Private Sub fg2_KeyPress(keyascii As Integer)
msflexgridedit fg2, txtedit, keyascii
End Sub
Function fgi(r As Integer, c As Integer) As Integer
fgi = c + fg2.Cols * r
End Function

Private Sub txtedit_KeyDown(KeyCode As Integer, Shift As Integer)
EditKeyCode fg2, txtedit, KeyCode, Shift
End Sub

Private Sub txtedit_KeyPress(keyascii As Integer)
Dim linea As Integer
If keyascii = 13 Then
keyascii = 0
If fg2.Col < fg2.Cols - 1 Then
fg2.Col = fg2.Col + 1
Else:
fg2.Col = 2
If fg2.Row < fg2.Rows - 1 Then
fg2.Row = fg2.Row + 1
Else:
fg2.Rows = fg2.Rows + 1
linea = fg2.Rows - 1
fg2.TextMatrix(linea, 0) = Format$(linea, "00")
fg2.Row = fg2.Row + 1
contador = contador + 1
fg2.TextMatrix(linea, 1) = Format$(contador, "00")
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