|
-
Jul 8th, 2008, 08:11 PM
#1
Thread Starter
New Member
openfiledialog with no browsing
I would like to have something like the openfiledialog, but disable the browsing of folders other than sub folders of the InitialDirectory. So no "Look in:"
and it would be nice to disable the places bar to the left without having to modify the registry before showing the dialog.
Can this be done with vb 2005?
in my case I only want files to be listed that are on the cdrom...
Code:
Dim allDrives() As IO.DriveInfo = IO.DriveInfo.GetDrives()
Dim d As IO.DriveInfo
For Each d In allDrives
If d.IsReady = True And d.DriveType = IO.DriveType.CDRom Then
OpenFileDialog1.InitialDirectory = d.Name
OpenFileDialog1.DefaultExt = "exe"
OpenFileDialog1.Filter = "exe files (*.exe)|*.exe"
OpenFileDialog1.ShowDialog()
End If
Next
Thanks for any help you can provide.
chris
-
Jul 8th, 2008, 08:32 PM
#2
Re: openfiledialog with no browsing
AFAIK, no. You can specify certain areas to filter like network domains etc but to prevent specific directories you will need to either write your own dialog or set permissions on the folders throughout your system. Obviously creating your own will be much easier.
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Jul 8th, 2008, 09:06 PM
#3
Re: openfiledialog with no browsing
Follow the Customising Common Dialogs link in my signature. It will give you the basics but you'd have to work out the specific messages and responses you need to handle for yourself.
-
Jul 8th, 2008, 09:22 PM
#4
Re: openfiledialog with no browsing
But with the amount of work/code that will take its really not worth it and wont get you everything you desire. IMO, it would be better for you to build your own exactly as you need it.
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Jul 8th, 2008, 09:27 PM
#5
Re: openfiledialog with no browsing
 Originally Posted by RobDog888
But with the amount of work/code that will take its really not worth it and wont get you everything you desire. IMO, it would be better for you to build your own exactly as you need it.
The advantage of using the existing class is that you get the consistent look and feel. I agree that it might be a fair bit of work though so, if maintaining complete consistency with the standard Windows UI is not critical, a custom dialogue would be easier. probably just a TreeView and a ListView would be the way to go.
-
Jul 8th, 2008, 09:32 PM
#6
Re: openfiledialog with no browsing
But with the amount of customizations and removals it will not follow any standards of Windows dialog so thats why I suggest building your own in this case.
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
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
|