Results 1 to 4 of 4

Thread: Toolbar/ImageList

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Nov 2007
    Location
    Rochester, NY
    Posts
    111

    Toolbar/ImageList

    I asked about this on the forums awhile back, and was given replies that these styles are the only way possible. Since I know alot of beginners and some intermediate visual programmers have questions about these two things, I decided to write a brief but in-depth example with three ways to implement the toolbar and imagelist into your application.

    1. A pre-set imagelist
    2. Load Images from a set directory
    3. Let the consumer (user) chooses

    Hope it helps anyone looking for answers on thsi subject =)
    Attached Files Attached Files
    Please use the search function prior to posting a question and see if someone's already answered it.
    -If I helped you, please rate me, as I'd do the same for you =)
    -Remember to select the Resolved option for your post when you've gotten the answers you need.

  2. #2
    Hyperactive Member
    Join Date
    May 2001
    Posts
    414

    Re: Toolbar/ImageList

    Thanks for the code. In your Load Images from a set directory example,
    how would you add all the icons in the directory wihtout having to specify each one individually?

  3. #3
    VB For Fun Edgemeal's Avatar
    Join Date
    Sep 2006
    Location
    WindowFromPoint
    Posts
    4,255

    Re: Toolbar/ImageList

    Quote Originally Posted by jdc6029 View Post
    Thanks for the code. In your Load Images from a set directory example,
    how would you add all the icons in the directory wihtout having to specify each one individually?
    You can use the Dir command to get file names, something like,....

    Code:
    'Load the images to the respective ImageList
    Dim strDir As String
    Dim strFile As String
    Dim intCount As Integer
    ' set path
    strDir = App.Path & "\gfx\One\"
    ' get all "*.ico" filenames in strDir folder
    strFile = Dir(strDir & "*.ico", vbNormal)
    Do Until strFile = vbNullString
        intCount = intCount + 1
        ' add to img list
        Call ImageList1.ListImages.Add(intCount, "", LoadPicture(strDir & strFile))
        strFile = Dir ' get next filename
    Loop
    
    ' [continue with the rest of code]
    'Set the toolbar so that it reads.......

  4. #4
    Hyperactive Member
    Join Date
    May 2001
    Posts
    414

    Re: Toolbar/ImageList

    Thanks!

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