C# Tutorials and offshore development in India
    Tutorials   Resources   Forum   Reviews   Communities   Interview   Jobs   Projects   Training   Your Ad Here    
Silverlight Games | Mentor | Code Converter | Articles | Code Factory | Computer Jokes | Members | Peer Appraisal | IT Companies | Bookmarks | Polls | Revenue Sharing | Lobby | Gift Shop |


Prizes & Awards
My Profile



Active Members
TodayLast 7 Days more...






Resources » Code Snippets » VB.NET Syntax »

Adding filters to the Open File dialog and Selecting Multiple Files


Posted Date: 12 Nov 2008    Resource Type: Code Snippets    Category: VB.NET Syntax
Author: Abraham KuriakoseMember Level: Gold    
Rating: 1 out of 5Points: 5



This sample VB.net code snippet shows how to add filters to the Open File dialog and Selecting Multiple Files.


OpenFileDialog1.Filter = "Media Files|*.mpg;*.avi;*.wma;*.mid;*.wav;*.mp2;*.mp3|All Files|*.*"

OpenFileDialog1.FilterIndex = 1
OpenFileDialog1.InitialDirectory = "C:\"
OpenFileDialog1.Title = "Open File"
If (OpenFileDialog1.ShowDialog() = Windows.Forms.DialogResult.OK) Then
If (OpenFileDialog1.FileNames.Length > 0) Then
' Make sure the User selected one or more files
For Each strFileName As String In OpenFileDialog1.FileNames
List1.Items.Add(strFileName)
' Loop through the list of selected filenames and add each one to your listbox
Next
End If
End If



Responses


No responses found. Be the first to respond and make money from revenue sharing program.

Feedbacks      
Popular Tags   What are tags ?   Search Tags  
Sign In to add tags.
Openfile dialog  .  Multiple file selection  .  

Post Feedback


This is a strictly moderated forum. Only approved messages will appear in the site. Please use 'Spell Check' in Google toolbar before you submit.
You must Sign In to post a response.
Next Resource: Winsock Component
Previous Resource: Open File Dialog Control
Return to Discussion Resource Index
Post New Resource
Category: VB.NET Syntax


Post resources and earn money!
 
More Resources



dotNet Slackers

About Us    Contact Us    Privacy Policy    Terms Of Use