Dear visitor, welcome to Jabaco - Community. If this is your first visit here, please read the Help. It explains in detail how this page works. To use all features of this page, you should consider registering. Please use the registration form, to register here or read more information about the registration process. If you are already registered, please login here.
Trainee
Date of registration: Jul 11th 2014
About me: A beginner programmer.
Location: ...Jabaco Academy
Occupation: i have some but still not enough...
Hobbies: Jabaco
i cant seems to find any answers for detecting any pictures in a certain folder. I wanted to have a simple form with a combo box. Upon starting the application It would Detect all the picture inside the folder and display the names in the dropdown. is that possible.. please I need help.
Trainee
Date of registration: Jul 11th 2014
About me: A beginner programmer.
Location: ...Jabaco Academy
Occupation: i have some but still not enough...
Hobbies: Jabaco
This post has been edited 1 times, last edit by "spysonic" (Jul 28th 2014, 10:44am)
Trainee
Date of registration: Jul 11th 2014
About me: A beginner programmer.
Location: ...Jabaco Academy
Occupation: i have some but still not enough...
Hobbies: Jabaco
Quoted
my only problem now is to limit the detection to a certain file. like for example instead of detecting all files perhaps it should only detect PICTURES files with .bmp, jpg or png extensions.
Jabaco Source |
|
1 |
Dim myPattern As String = "*.*" |
by the way HOW do i post the code here? i tried several times but after submitting the reply the code structure gets displayed in lines as in like a paragraph
This post has been edited 1 times, last edit by "Dani" (Jul 30th 2014, 3:22pm)
Trainee
Date of registration: Jul 11th 2014
About me: A beginner programmer.
Location: ...Jabaco Academy
Occupation: i have some but still not enough...
Hobbies: Jabaco
Jabaco Source |
|
1 |
Dim myPattern As String = "*.*" |
Trainee
Date of registration: Jul 11th 2014
About me: A beginner programmer.
Location: ...Jabaco Academy
Occupation: i have some but still not enough...
Hobbies: Jabaco
This post has been edited 1 times, last edit by "spysonic" (Jul 30th 2014, 3:08am)
Trainee
Date of registration: Jul 11th 2014
About me: A beginner programmer.
Location: ...Jabaco Academy
Occupation: i have some but still not enough...
Hobbies: Jabaco
Jabaco Source |
|
1 |
myItem = myList(i).getName() |
Jabaco Source |
|
1 2 3 4 5 6 7 8 9 10 11 |
For i = 0 To Ubound(myList) myItem = myList(i).getName() filetype = Right (myItem,3) If (myList(i).isFile()=True) Then IF (NOT (myHidden=False AND myList(i).isHidden() = True)) Then If filetype = "png" Then: List1.AddItem(myList(i).getName()) If filetype = "jpg" Then: List1.AddItem(myList(i).getName()) If filetype = "bmp" Then: List1.AddItem(myList(i).getName()) End If End If Next |
This post has been edited 3 times, last edit by "spysonic" (Jul 30th 2014, 3:07am)
Trainee
Date of registration: Jul 11th 2014
About me: A beginner programmer.
Location: ...Jabaco Academy
Occupation: i have some but still not enough...
Hobbies: Jabaco
Jabaco Source |
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 |
Private Sub Update_Filename_List() Me.Clear() Dim myFile As New java#io#File(myDirectory) Dim myList = myFile.listFiles Dim i, x As Integer Dim tmpString As java#lang#String Dim tmpPos As Integer Dim tmpExt As String Dim tmpPat() As String tmpPat() = Split(myPattern,",") For i = 0 To Ubound(myList) If (myList(i).isFile()= True) Then IF (NOT (myHidden=False AND myList(i).isHidden() = True)) Then If myPattern = "*.*" Then Me.AddItem(myList(i).getName()) Else tmpString = myList(i).getName() tmpPos = tmpString.lastIndexOf(".") If tmpPos > 0 Then tmpExt = "*" & tmpString.substring(tmpPos).toLowerCase() For x = 0 To Ubound(tmpPat()) If tmpExt = tmpPat(x) Then Me.AddItem(myList(i).getName()) Next x End If End If End If End If DoEvents Next i End Sub |
Jabaco Source |
|
1 |
File1.Pattern = "*.txt,*.html" |