Private Type LVBKIMAGE
ulFlags As Long hBitmap As Long pszImage As String cchImageMax As Long xOffsetPercent As Long yOffsetPercent As Long End Type Private Const LVM_FIRST = &H1000& Private Const LVM_SETTEXTBKCOLOR = (LVM_FIRST + 38) Private Const LVM_SETBKIMAGE = (LVM_FIRST + 68) Private Const LVBKIF_SOURCE_URL = &H2 Private Const LVBKIF_STYLE_TILE = &H10 Private Const CLR_NONE = &HFFFFFFFF Private Declare Function SendMessage Lib "user32" _ Alias "SendMessageA" (ByVal hwnd As Long, _ ByVal lMsg As Long, ByVal wParam As Long, _ lParam As Any) As Long '_________________________________________________________ Private Sub Form_Load() Dim tLVBKImage As LVBKIMAGE With tLVBKImage .ulFlags = LVBKIF_SOURCE_URL Or LVBKIF_STYLE_TILE .pszImage = "c:\windows\clouds.bmp" .cchImageMax = Len(.pszImage) End With SendMessage ListView1.hwnd, LVM_SETTEXTBKCOLOR, 0, ByVal CLR_NONE SendMessage ListView1.hwnd, LVM_SETBKIMAGE, 0, tLVBKImage End Sub For this To work, you need comctl32.dll version 4.71 Or greater the version that came with IE 4.0. Create a New project And drop a ListView control onto a form. Then paste the following into the form's code window: |