1
Visual Basic 6 / Re:como leer los option button en archivo secuencial
« en: Mayo 16, 2024, 03:43:51 pm »
cambia el evento Command5_Click por este código 

Código: [Seleccionar]
Private Sub Command5_Click()
Dim F_check1, F_check2, F_check3, F_check4 As Integer
cd1.InitDir = App.Path & "\fichero estudiante\"
cd1.ShowOpen
Open cd1.Filename For Input As #1
Do While EOF(1) <> -1
Input #1, mat, nom, postnom, F_check1, F_check2, sexe, F_check3, F_check4, price, datenaiss, adresse
Text1 = mat
Text2 = nom
Text3 = postnom
Text4 = datenaiss
Text5 = adresse
If CBool(F_check1) = True Then
Option1(0).value = True
Else
Option1(1).value = True
End If
'If Option1(index).value = True Then
' Option1(0).Caption = F_check1
' Text6.Text = sexe
'Else
' Option1(1).Caption = F_check2
' Text6.Text = sexe
'End If
Text6.Text = sexe
If CBool(F_check3) = True Then
Option2(0).value = True
Else
Option2(1).value = True
End If
'If Option2(index).value = True Then
' Option2(0).Caption = F_check3
'Else
' Option2(1).Caption = F_check4
'End If
Text7.Text = price
Loop
Close #1
End Sub