El Guru Programador
Usuario DESCONOCIDO | Registrate Gratis | Usuarios Registrados
Foro de Visual Basic/VB.NET
Foros del Guru > Visual Basic/VB.NET
Usuario Me pueden ayudar con una duda....b...
Desconocido
Enviado - 15/10/2004
 
Hola...tengo el siguiente codigo en Visual Basic 6.0 el cual me permite ke distintos botones realizan llamadas según el caso, el tema es ke perdi la configuracion de los botones....y no recuerdo como hacer para ke cada boton llame al procedimiento....
Si alguien me ayuda.....pues estariamos de pelos....weissssss
Private Sub boton_menu_Click(Index As Integer)
Select Case Index
Case 0
Call Limpiar_Variables
txt_codigo.SetFocus
Case 1
If VP_GRABAR = 0 Then
MsgBox "NO TIENE EL PRIVILEGIO DE GRABAR", vbCritical, "USUARIO"
Exit Sub
End If
If Trim(txt_codigo) = "" Then
MsgBox "INGRESE CODIGO ", vbCritical
txt_codigo.SetFocus
Exit Sub
End If
If Trim(txt_nombre) = "" Then
MsgBox "INGRESE NOMBRE", vbCritical
txt_nombre.SetFocus
Exit Sub
End If
If cmb_cargo.ListIndex = -1 Or Trim(lbl_dpto) = "" Then
MsgBox "TIENE QUE SELECCIONAR UN CARGO", vbCritical, "ERROR"
cmb_cargo.SetFocus
Exit Sub
End If
If IsNumeric(Mid(txt_rut, 1, 8)) = False Then
MsgBox "RUT MAL INGRESADO", vbCritical, "Advertencia"
txt_rut.SetFocus
Exit Sub
End If
If ValRut(Val(Mid(txt_rut, 1, 8)), Mid(txt_rut, 10, 1)) = False Then
MsgBox "RUT MAL INGRESADO", vbCritical, "Advertencia"
txt_rut.SetFocus
Exit Sub
End If
If 7 <> MsgBox("Confirma Grabación !!!!", vbQuestion + vbYesNo, "ADVERTENCIA") Then
Call Grabar_Datos
End If
Case 2
If VP_ELIMINAR = 0 Then
MsgBox "NO TIENE EL PRIVILEGIO DE ELIMINAR", vbCritical, "USUARIO"
Exit Sub
End If
If 7 <> MsgBox("ELIMINA DATOS !!!!", vbQuestion + vbYesNo, "ADVERTENCIA") Then
VP_SQL = ""
VP_SQL = "DELETE FROM FICHA_TRABAJADORES WHERE CODIGO_T=" & Val(txt_codigo) & ""
bases.Execute VP_SQL, dbExecDirect
Call Limpiar_Variables
txt_codigo.SetFocus
End If
Case 3
Case 4
Unload Me
End Select
End Sub

 
the_ma3x
11 Mensaje(s)
Enviado - 15/10/2004
 
No basta con que el boton se llame igual y selecciones el no del Index al que pertenece cada boton?

Slaudos
 
xVBx
5 Mensaje(s)
Enviado - 18/10/2004
 
No entendí si no sabes el Index de tus botones por que los perdiste o por que cambian...

Lo que puedes hacer es tambien utilizar:

Select Case miboton(Index).Caption
Case "Aceptar"
'..rutina....
End Select

 
 

 

Contactos myStudio Network