Searching \ for '[OT] Visual Basic Again' in subject line. ()
Make payments with PayPal - it's fast, free and secure! Help us get a faster server
FAQ page: www.piclist.com/techref/language/index.htm?key=basic
Search entire site for: 'Visual Basic Again'.

Exact match. Not showing close matches.
PICList Thread
'[OT] Visual Basic Again'
2000\03\27@142658 by Sean Breheny

face picon face
Sorry to ask another question about VB on here, but last time I asked I
got good answers, so I will do it again :-P

WHat is the best way to create a box which allows the user to select
EITHER individaul files OR directories OR both at the same time (i.e., it
allows multiple selections)? IN addition, it should be able to access the
network to select files and directories from other machines.

THanks,

Sean

2000\03\27@143909 by Andrew Kunz

flavicon
face
Can't be too hard, probably just a property in the standard fileopen dialog.
Most editors allow you to grab a bunch at once and it's using the std dialog, so
I would just suggest you hunt on the property sheet.

PFE calls the option (under Preferences) "Select multiple files in File
Open/View dialog" in case that's any help.

Andy










Sean Breheny <spam_OUTshb7TakeThisOuTspamCORNELL.EDU> on 03/27/2000 02:25:16 PM

Please respond to pic microcontroller discussion list <.....PICLISTKILLspamspam@spam@MITVMA.MIT.EDU>








To:      PICLISTspamKILLspamMITVMA.MIT.EDU

cc:      (bcc: Andrew Kunz/TDI_NOTES)



Subject: [OT] Visual Basic Again








Sorry to ask another question about VB on here, but last time I asked I
got good answers, so I will do it again :-P

WHat is the best way to create a box which allows the user to select
EITHER individaul files OR directories OR both at the same time (i.e., it
allows multiple selections)? IN addition, it should be able to access the
network to select files and directories from other machines.

THanks,

Sean

2000\03\27@145622 by Sean Breheny

face picon face
Hi Andy,

Thanks, although I have been staring at the help files for the fileopen
dialog for weeks now and can't find any way to do it. The sticking point
is NOT multiple files (I can see how to do that), the problem is being
able to select a directory (not selecting all the files IN the dir, but
selecting the dir name itself as if it were a file).

Any ideas?

Sean


On Mon, 27 Mar 2000, Andrew Kunz wrote:

{Quote hidden}

2000\03\27@150926 by Andrew Kunz

flavicon
face
I think the open dialog is too smart for that.  Bill's Boys probably said, "Nah,
what fool would want to do that?"

FWIW, are you talking about something along the lines of Explorer selecting
multiple dir/file combos?  (You can select the whole dir at the higher level,
but that implies selecting all the files in it).

Andy

2000\03\27@152417 by Sean Breheny

face picon face
Hi again Andy,

Yeah, that's the impression I got of the open dialog.

Here's what I am doing: I'm writing a simple program which will
periodically copy a bunch of files and directories from several other
machines to a "server" for backup purposes. Because the files IN those
directories can change, I can't simply select all the files in the dirs,
I have to select the dir name. I also want the capability to select
individual files for cases where you only want to back up one file from a
directory, etc. These selections will go into a text file as
path+filename strings. WHen the program needs to do the actual copy, it
will open the text file and just go down the list, performing each copy.

Sean


On Mon, 27 Mar 2000, Andrew Kunz wrote:

> I think the open dialog is too smart for that.  Bill's Boys probably said, "Nah,
> what fool would want to do that?"
>
> FWIW, are you talking about something along the lines of Explorer selecting
> multiple dir/file combos?  (You can select the whole dir at the higher level,
> but that implies selecting all the files in it).
>
> Andy
>

2000\03\27@153218 by Tim Hamel

picon face
Hi..I'm not sure if this is what you want, it copies the directory name into
a variable (sBuffer). This uses a different dialog than the one you'd expect.
You'll have to modify per your requirements.

Regards,

Tim Hamel

(Sorry for the lengthy code)
Option Explicit

              Private Const BIF_RETURNONLYFSDIRS = 1
              Private Const BIF_DONTGOBELOWDOMAIN = 2
              Private Const MAX_PATH = 260

              Private Declare Function SHBrowseForFolder Lib _
              "shell32" (lpbi As BrowseInfo) As Long

              Private Declare Function SHGetPathFromIDList Lib _
              "shell32" (ByVal pidList As Long, ByVal lpBuffer _
              As String) As Long

              Private Declare Function lstrcat Lib "kernel32" _
              Alias "lstrcatA" (ByVal lpString1 As String, ByVal _
              lpString2 As String) As Long

              Private Type BrowseInfo
                 hWndOwner As Long
                 pIDLRoot As Long
                 pszDisplayName As Long
                 lpszTitle As Long
                 ulFlags As Long
                 lpfnCallback As Long
                 lParam As Long
                 iImage As Long
              End Type

              Private Sub Command1_Click()
              'Opens a Browse Folders Dialog Box that displays the
              'directories in your computer
              Dim lpIDList As Long 'Declare Varibles
              Dim sBuffer As String
              Dim szTitle As String
              Dim tBrowseInfo As BrowseInfo

              szTitle = "Hello World. Click on a directory and " & _
              "it's path will be displayed in a message box"
              'Text to appear in the the gray area under the title bar
              'telling you what to do

              With tBrowseInfo
                 .hWndOwner = Me.hWnd 'Owner Form
                 .lpszTitle = lstrcat(szTitle, "")
                 .ulFlags = BIF_RETURNONLYFSDIRS + BIF_DONTGOBELOWDOMAIN
              End With

              lpIDList = SHBrowseForFolder(tBrowseInfo)

              If (lpIDList) Then
                 sBuffer = Space(MAX_PATH)
                 SHGetPathFromIDList lpIDList, sBuffer
                 sBuffer = Left(sBuffer, InStr(sBuffer, vbNullChar) - 1)
                 MsgBox sBuffer
              End If

              End Sub

In a message dated 3/27/00 12:24:26 PM Pacific Standard Time,
@spam@shb7KILLspamspamCORNELL.EDU writes:

{Quote hidden}

2000\03\27@194020 by Sean Breheny

face picon face
Hi Tim!

Thanks, I am not at the machine with VB on it now, but I will try it when I
get a chance.

Sean

At 03:30 PM 3/27/00 EST, you wrote:
>Hi..I'm not sure if this is what you want, it copies the directory name into
>a variable (sBuffer). This uses a different dialog than the one you'd expect.

|
| Sean Breheny
| Amateur Radio Callsign: KA3YXM
| Electrical Engineering Student
\--------------=----------------
Save lives, please look at http://www.all.org
Personal page: http://www.people.cornell.edu/pages/shb7
KILLspamshb7KILLspamspamcornell.edu ICQ #: 3329174

2000\03\27@194036 by Bill Pierce

picon face
<x-flowed>The Windows call to make is SHBrowseForFolder and its located in
shell32.dll. Hope that helps.

Bill

{Quote hidden}

______________________________________________________
Get Your Private, Free Email at http://www.hotmail.com

</x-flowed>

2000\03\27@194052 by Randy A.

picon face
Andy:

I am not sure you can select a directory like a file.  Even in Windows all I
think you can do is "open" the directory or "folder"  to see what is inside
it.  At least I have never found a way to do it, and if that is true I would
think the same would be true about VB as it is based on the Windows
environment.  Open Windows Explorer and see if you can select more than one
Folder in it, I don't think you will be able to do it.  However, there are a
LOT of thing I don't know about VB and Windows just like most others.

Regards,
Randy A.

2000\03\28@105629 by Andrew Kunz

flavicon
face
You can select a directory as well as individual files at the same level in the
tree.

Use Windows Exploder to see how it's done.  Ctrl-Click on multiple items on the
RIGHT side of the screen.

Andy











"Randy A." <RemoveMECnc002EraseMEspamEraseMEAOL.COM> on 03/27/2000 05:31:13 PM

Please respond to pic microcontroller discussion list <RemoveMEPICLISTspam_OUTspamKILLspamMITVMA.MIT.EDU>








To:      RemoveMEPICLISTTakeThisOuTspamspamMITVMA.MIT.EDU

cc:      (bcc: Andrew Kunz/TDI_NOTES)



Subject: Re: [OT] Visual Basic Again








Andy:

I am not sure you can select a directory like a file.  Even in Windows all I
think you can do is "open" the directory or "folder"  to see what is inside
it.  At least I have never found a way to do it, and if that is true I would
think the same would be true about VB as it is based on the Windows
environment.  Open Windows Explorer and see if you can select more than one
Folder in it, I don't think you will be able to do it.  However, there are a
LOT of thing I don't know about VB and Windows just like most others.

Regards,
Randy A.

2000\03\28@105644 by Andrew Kunz
flavicon
face
If I were a user, I think I would prefer to a custom dialog.  My preference
would be to see a tree-like diagram, which would allow selection of nodes on
multiple branches.

Andy










Sean Breheny <EraseMEshb7spamspamspamBeGoneCORNELL.EDU> on 03/27/2000 03:21:49 PM

Please respond to pic microcontroller discussion list <RemoveMEPICLISTKILLspamspamMITVMA.MIT.EDU>








To:      PICLISTSTOPspamspamspam_OUTMITVMA.MIT.EDU

cc:      (bcc: Andrew Kunz/TDI_NOTES)



Subject: Re: [OT] Visual Basic Again








Hi again Andy,

Yeah, that's the impression I got of the open dialog.

Here's what I am doing: I'm writing a simple program which will
periodically copy a bunch of files and directories from several other
machines to a "server" for backup purposes. Because the files IN those
directories can change, I can't simply select all the files in the dirs,
I have to select the dir name. I also want the capability to select
individual files for cases where you only want to back up one file from a
directory, etc. These selections will go into a text file as
path+filename strings. WHen the program needs to do the actual copy, it
will open the text file and just go down the list, performing each copy.

Sean


On Mon, 27 Mar 2000, Andrew Kunz wrote:

> I think the open dialog is too smart for that.  Bill's Boys probably said,
"Nah,
> what fool would want to do that?"
>
> FWIW, are you talking about something along the lines of Explorer selecting
> multiple dir/file combos?  (You can select the whole dir at the higher level,
> but that implies selecting all the files in it).
>
> Andy
>

2000\03\28@105745 by Sean Breheny

face picon face
Thanks Bill, I will give it a try...

Sean

At 02:06 PM 3/27/00 PST, you wrote:
>The Windows call to make is SHBrowseForFolder and its located in
>shell32.dll. Hope that helps.
>
>Bill
>

|
| Sean Breheny
| Amateur Radio Callsign: KA3YXM
| Electrical Engineering Student
\--------------=----------------
Save lives, please look at http://www.all.org
Personal page: http://www.people.cornell.edu/pages/shb7
spamBeGoneshb7STOPspamspamEraseMEcornell.edu ICQ #: 3329174

More... (looser matching)
- Last day of these posts
- In 2000 , 2001 only
- Today
- New search...