Hola Darío:
Hace un tiempo tuve la misma duda que vos, ésta fue la solución que me envío otro listero, espero que te ayude.
Alejandro:
Lo que tenes que = hacer es:
1) Poner en la columna del DBGrid la propiedad = Button=3Dtrue
2) Crear un ListBox Con los elementos a = seleccionar y con la propiedad Visible =3D False
3) En el = evento ButtonClick del DBGrid tenes que colocar el ListBox gusto debajo = de las celda actual para que junto con la celda ( con boton) se = forme un combo. En este evento debes mostrar el ListBox y activarlo si = ListBox.Visible=3DFalse y ocultarlo si es True. Para uvicar el LitBox = debajo de la celda:
lstNivel.Move dbgFamilia.Left + = dbgFamilia.Columns(GridNivel).Left, dbgFamilia.Top + = dbgFamilia.RowTop(.Row) + dbgFamilia.RowHeight, = dbgFamilia.Columns(GridNivel).Width
4) En el evento = RowColChange cuando se activa la columna del ListBox debes hacerlo y = Visible y ocultarlo cuando se desactiva la columna ( idem = ButtonClick)
5) Luego tenes que programar los eventos del = ListBox para que pasa la Seleccion al DBGrid
Te mando un = fragmento de c=F3digo de un programa que lo hace, si no lo entendes = avisame
Private Sub dbgFamilia_ButtonClick(ByVal ColIndex As = Integer)
If ColIndex =3D GridNivel Then
If = lstNivel.Visible Then
= lstNivel.Visible =3D False
= Else
= With dbgFamilia
= lstNive= l.Move .Left + .Columns(GridNivel).Left, .Top + .RowTop(.Row) + = .RowHeight, .Columns(GridNivel).Width ', .RowHeight
= End With
= With lstNivel
= .Visibl= e =3D True
= .SetFoc= us
End With
= End If
End If
End Sub
Private Sub = dbgFamilia_RowColChange(LastRow As Variant, ByVal LastCol As = Integer)
If LastCol =3D GridNivel Then
= dbgFamilia.Columns(GridNivel).Button =3D False
End = If
If dbgFamilia.Col =3D GridNivel Then
= dbgFamilia.Columns(GridNivel).Button =3D True
= With dbgFamilia
= lstNivel.Move .Left + = .Columns(GridNivel).Left, .Top + .RowTop(.Row) + .RowHeight, = .Columns(GridNivel).Width ', .RowHeight
End = With
With lstNivel
= .Visible =3D True
= .SetFocus
= End With
End If
End Sub
Private Sub = lstNivel_Click()
Dim i%
With lstNivel
= If .ListIndex <> -1 = Then
= d= bgFamilia.Columns(GridNivel) =3D .Text
= End If
= End With
End Sub
Private Sub = lstNivel_DblClick()
With lstNivel
= .Visible =3D False
= dbgFamilia.SetFocus
= End With
End Sub
Private Sub = lstNivel_KeyPress(KeyAscii As Integer)
If KeyAscii = =3D 13 Or 27 Then
With = lstNivel
= .Visibl= e =3D False
= dbgFami= lia.SetFocus
= SendKey= s Chr(KeyAscii)
End = With
End If
End Sub
Private Sub = lstNivel_LostFocus()
With lstNivel
= If .ListIndex <> -1 = Then
= dbgFami= lia.Columns(GridNivel) =3D .Text
= End If
= .Visible =3D False
End = With
End Sub
'
****************************
Ing. Marcos = Mellibovsky
mellibo@satlink.com
C=F3rdoba - = Argentina
****************************
------=_NextPart_000_01BCCDDF.1A9673C0-
Alejandro Belkin
abelkin@bas.com.ar
-----Mensaje original-----
De: =?UNKNOWN-8BIT?Q?"Dar=EDo?= Segovia [SMTP:dariosegovia@hotmail.com]
Enviado el: miércoles 18 de febrero de 1998 23:55
Para: vb-esp@ccc.uba.ar
Asunto: (VB-ESP) DBCombo dentro de los DBGrid
<
Resumen