1
Visual Basic 6 / Fondo en control ListBoxEx
« en: Octubre 14, 2014, 02:33:11 am »
Buenas noches primeramente agradecer los aportes de la web que me han ayudado mucho, les comento que he estado usando el control ListboxEx de leandro que me ha servido de mucho http://leandroascierto.com/blog/listboxex/ por el cual quize agregarle la propiedad u opcion de Poner una imagen de fondo en tiempo de ejecucion o en el evento Load del formulario y no desde diseño :
Pero sin exito ya que cuando me muevo por el control se borra el fondo haber si porfavor me echan una mano.
Saludos
Código: [Seleccionar]
' esta línea con las demás en la sección de declaracion de variables..
Private p_Imagen As IPictureDisp ' imagen autoajustable al fondo del control.
Public Property Get Imagen() As IPictureDisp
Set Imagen = p_Imagen
End Property
Public Property Set Imagen(ByVal i As IPictureDisp)
Set p_Imagen = i
Call DibujarTodo
End Property
Private Sub UserControl_InitProperties()
Set p_Imagen = UserControl.Picture
Set UserControl.Picture = Nothing
End Sub
Private Sub UserControl_ReadProperties(PropBag As PropertyBag)
Set p_Imagen = PropBag.ReadProperty("Imagen", Nothing)
End Sub
Private Sub UserControl_WriteProperties(PropBag As PropertyBag)
PropBag.WriteProperty "Imagen", p_Imagen, Nothing
End Sub
Private Sub DibujarImagen()
If Not (p_Imagen Is Nothing) Then
With UserControl
'.PaintPicture p_Imagen, 0, 0, .Width, .Height, 0, 0, ScaleX(p_Imagen.Width, vbHimetric, vbTwips), ScaleY(p_Imagen.Height, vbHimetric, vbTwips)
.PaintPicture p_Imagen, 0, 0
End With
End If
End Sub
Public Sub DibujarTodo()
UserControl.Cls
Call DibujarImagen
End SubPero sin exito ya que cuando me muevo por el control se borra el fondo haber si porfavor me echan una mano.
Saludos