Results 1 to 23 of 23

Thread: [RESOLVED] Upload PNG images into native Windows image list or vbAccelerator ImageList

Threaded View

  1. #12
    PowerPoster dilettante's Avatar
    Join Date
    Feb 2006
    Posts
    24,487

    Re: Upload PNG images into native Windows image list or vbAccelerator ImageList

    If that's all you want you are probably working too hard.

    For example with the Common Controls 6.x assembly for COMCTL32.OCX there isn't much to it:

    Code:
    Option Explicit
    
    'Requires a reference to: Microsoft Windows Image Acquisition Library v2.0
    
    Private Sub Form_Load()
        ChDir App.Path
        ChDrive App.Path
        With New WIA.Vector
            .BinaryData = LoadResData("FOLDER", "CUSTOM")
            ImageList1.ListImages.Add 1, , .Picture
        End With
        With New WIA.ImageFile
            .LoadFile "printer.png"
            ImageList1.ListImages.Add 2, , .FileData.Picture
        End With
        With Toolbar1
            Set .ImageList = ImageList1
            .Buttons(1).Image = 1
            .Buttons(2).Image = 2
        End With
    End Sub
    
    Private Sub Toolbar1_ButtonClick(ByVal Button As ComctlLib.Button)
        Select Case Button.Index
            Case 1
                MsgBox "Folder!"
            Case 2
                MsgBox "Printer!"
        End Select
    End Sub
    That example takes one image from a resource and the other from a disk file.

    Name:  sshot.png
Views: 1631
Size:  8.8 KB
    Attached Files Attached Files

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width