Results 1 to 2 of 2

Thread: VB6 - ImageListPicker Control

  1. #1

    Thread Starter
    PowerPoster dilettante's Avatar
    Join Date
    Feb 2006
    Posts
    24,487

    VB6 - ImageListPicker Control

    This is a simple GUI UserControl for "picking" from a list of pictures.

    Your program loads some pictures into it, then the user can scroll the visible list horizontally and click on one to select it.


    METHODS

    Add - Add a StdPicture to the list.

    Delete X - Delete picture X from the list. X from 1 to n.

    ClearAll - Clears the list.


    PROPERTIES

    ListItems(X) - Retrieves item X as a StdPicture object.

    ListIndex - Currently selected item, 0 = none selected.

    ThumbNailHeight, ThumbnailWidth - Visible size in pixels for the scrolling thumbnails.

    ThumbnailsMargin - Space between each thumbnail in pixels. Must be 3 or greater to allow room for the selection rectangle.


    EVENTS

    Click - Fired when user clicks on a thumbnail image.


    No special requirements or dependencies. Uses intrinsic VB6 controls and image operations. Just add the .CTL and .CTX files to your Project folder then add the control using Project|Add|File...

    Source provided in the attachment as part of a demo project, along with some sample pictures (which is why the attachment is so large).

    You could enhance it to add "tag" values, "file names" and so on. It would be easy enough to create a "vertical" version of this control too.
    Attached Images Attached Images  
    Attached Files Attached Files
    Last edited by dilettante; Jan 6th, 2013 at 08:05 AM. Reason: Updated attachment: small bug in demo though not in ImageListPicker itself

  2. #2

    Thread Starter
    PowerPoster dilettante's Avatar
    Join Date
    Feb 2006
    Posts
    24,487

    Re: VB6 - ImageListPicker Control

    Small bug fix above: the Form's ScaleMode was used instead of Picture1.ScaleMode in one place. No impact since they had the same value in this case, but still wrong.

    Also added three optional parameters to PaintCentered() routine in the demo project. You can now pass in a max width and/or max height to be used instead of the Picture1 picturebox's client area dimensions, and a zoom factor where 1.0 = 100%, 0.5 = 50%, etc.

    Not really part of ImageListPicker itself, but it's there now. Limited testing so far, so buyer beware.

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