|
-
Nov 21st, 2005, 09:29 AM
#1
Thread Starter
Registered User
XP-Style Search
How do I search a folder for a file?
-
Nov 21st, 2005, 09:33 AM
#2
Re: XP-Style Search
VB Code:
Private Sub Command1_Click()
If Dir$("c:\autoexec.bat") <> vbNullString Then
MsgBox "file exists"
Else
MsgBox "file doesn't exist"
End If
End Sub
-
Nov 21st, 2005, 09:37 AM
#3
Re: XP-Style Search
Hack,
i just forgot one thing, how can i search for multiple files within a folder?
-
Nov 21st, 2005, 09:40 AM
#4
Re: XP-Style Search
 Originally Posted by Harsh Gupta
Hack,
i just forgot one thing, how can i search for multiple files within a folder?
VB Code:
If Dir("c:\*.txt") <> vbNullString Then
MsgBox "Text files are in the root directory"
Else
MsgBox "No such file types exist"
End If
-
Nov 21st, 2005, 09:45 AM
#5
Re: XP-Style Search
my bad Hack, didn't post what exactly i wanted to ask.
if i am searching for text files within a folder (and its subfolder), i want to create a list of all text files, probably in a listbox showing their names. how can i do that?
-
Nov 21st, 2005, 09:53 AM
#6
Thread Starter
Registered User
Re: XP-Style Search
Thanks Hack... Is it possible to add a reference that allows me to utilize an F3 thype search?
-
Nov 21st, 2005, 09:58 AM
#7
Re: XP-Style Search
 Originally Posted by Harsh Gupta
my bad Hack, didn't post what exactly i wanted to ask.
if i am searching for text files within a folder (and its subfolder), i want to create a list of all text files, probably in a listbox showing their names. how can i do that?
VB Code:
Private Sub Command1_Click()
Dim strFiles As String
strFiles = Dir("d:\*.txt")
Do While strFiles > ""
List1.AddItem strFiles
strFiles = Dir
Loop
End Sub
-
Nov 21st, 2005, 09:59 AM
#8
Re: XP-Style Search
 Originally Posted by stealth black
Thanks Hack... Is it possible to add a reference that allows me to utilize an F3 thype search?
What do you mean by an "F3 type search"?
-
Nov 21st, 2005, 10:09 AM
#9
Re: XP-Style Search
Thanks Hack.
 Originally Posted by Hack
What do you mean by an "F3 type search"? 
he means that whenever user presses F3, it must trigger the Search button. i believe that F3 is a common Shortcut for searching, in Windows.
-
Nov 21st, 2005, 10:13 AM
#10
Re: XP-Style Search
 Originally Posted by Harsh Gupta
Thanks Hack.
he means that whenever user presses F3, it must trigger the Search button. i believe that F3 is a common Shortcut for searching, in Windows.
Gotcha. Set the Form's KeyPreview property to True, and play around with this.
VB Code:
Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = vbKeyF3 Then
'run search code
End If
End Sub
-
Nov 21st, 2005, 11:01 AM
#11
Thread Starter
Registered User
Re: XP-Style Search
Ok... Do you know what the code is for the search companion?
-
Nov 21st, 2005, 11:04 AM
#12
Re: XP-Style Search
 Originally Posted by stealth black
Ok... Do you know what the code is for the search companion?
Search companion?
-
Nov 21st, 2005, 11:41 AM
#13
Thread Starter
Registered User
Re: XP-Style Search
Ok, in XP, when you are in any folder brower, you press F3 and you get the search feature in the left pane. (You know, the dog, the magician, etc...) I'm building a resource locator for the customer service reps here, to bring all the crap they use in a day together. I am wanting it to be an XP style search for various PDFs and image file I have created for them....
-
Nov 21st, 2005, 11:44 AM
#14
Re: XP-Style Search
I think the panels are COM components, but might be mistaken.
-
Nov 21st, 2005, 11:47 AM
#15
Thread Starter
Registered User
Re: XP-Style Search
Hmm, like the Microsoft Common references?
-
Nov 21st, 2005, 11:49 AM
#16
Re: XP-Style Search
Not really... Do you know what they are called? Because I have clean forgotten. Is it "Explorer Panes" or "Explorer Bars" ?
-
Nov 21st, 2005, 11:59 AM
#17
Re: XP-Style Search
Well I don't know how you'd even start to go about implementing the shell ones in your own application (I looked a bit and found nothing), but if you feel like creating your own with a similar feel, vbAccelerator has an XP-style Explorer Bar control here.
-
Nov 21st, 2005, 12:10 PM
#18
Thread Starter
Registered User
Re: XP-Style Search
Hey wait a minute! This is exactly what I need!
Too cool! Thanks
-
Nov 21st, 2005, 12:11 PM
#19
Re: XP-Style Search
No problem, glad it helped
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|