Click here to Skip to main content
16,018,158 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I'm creating thumb nail images but it creates a problem in the form load event.

Drive1 = "E:\"
Dir1.Path = "Project"

error path not found

I don't know why. Please help me.

VB
Private Sub Command1_Click()
   Dim I, C As Integer
   C = File1.ListCount
   MsgBox C

   If C > 9 Then
     C = 9
   End If

   For I = 0 To C
      File1.ListIndex = I
      Image1.Item(I) = LoadPicture(Dir1.Path & "" & "/" & File1.FileName)
   Next

End Sub

Private Sub Command2_Click()
   graphics.Hide
   b1.Show
End Sub

Private Sub Dir1_Change()
   File1.Path = Dir1.Path
End Sub

Private Sub Drive1_Change()
   On Error GoTo tt:

   Dir1.Path = Drive1
   Exit Sub
   tt:

   MsgBox "The divice cannot acces"
End Sub

Private Sub Form_Load()
   List1.AddItem "*.jpg"
   List1.AddItem "*.bmp"
   List1.AddItem "*gif"
   Drive1 = "E:\"
   Dir1.Path = "Project"
   Image1(Index).Stretch = True
End Sub

Private Sub Image1_DblClick(Index As Integer)
   g2.Show
   g2.Image1.Picture = Image1.Item(Index).Picture
End Sub

Private Sub Image1_MouseMove(Index As Integer, Button As Integer, Shift As Integer, X As Single, Y As Single)
   Image1.Item(Index).ToolTipText = Dir1.Path & File1.FileName
End Sub

Private Sub List1_Click()
   File1.Pattern = List1.Text
End Sub
Posted
Updated 11-Nov-11 10:50am
v2

1 solution

You don't specify what kind of object Dir1 is, but I'm guessing that if you're setting something called "Path" that it might be looking for an whole directory path, not just the name of the last folder. For example, it might be looking for "E:\Project" instead of just "Project". Another possibility is that there just isn't a folder called "Project" there. Or you are missing the slash that goes between the directory and file name. Try debugging to find out what values are really being used.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900