Results 1 to 2 of 2

Thread: select the image from fielistbox

  1. #1

    Thread Starter
    Frenzied Member
    Join Date
    Feb 2007
    Location
    Malaysia
    Posts
    1,370

    select the image from fielistbox

    I use filelistbox, drivelistbox and dirlistbox

    I have problem.. I can see the image file in filelistbox when I browse the file.How I can select the file from filelistbox and click the button to view the image?

    Code:
    For i = 0 To File1.ListCount - 1 
    strFullPath = Dir1.Path & "\" & File1.List(i) 
    next i
    Last edited by matrik02; Jun 1st, 2007 at 10:00 PM.

  2. #2
    Addicted Member cxj98's Avatar
    Join Date
    Feb 2007
    Posts
    170

    Re: select the image from fielistbox

    Code:
    Private Const SW_SHOWNORMAL = 1
    
    Private Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" ( _
            ByVal Hwnd As Long, _
            ByVal lpszOp As String, _
            ByVal lpszFile As String, _
            ByVal lpszParams As String, _
            ByVal lpszDir As String, _
            ByVal FsShowCmd As Long) _
            As Long
    Private Declare Function GetDesktopWindow Lib "user32" () As Long
    
    Private Sub File1_DblClick()
        Call ShellExecute(GetDesktopWindow, "Open", IIf(Right$(File1.Path, 1) = "\", File1.Path, File1.Path & "\") & File1.FileName, "", "c:", SW_SHOWNORMAL)
    End Sub

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