Article
    C#
    ADO.Net
    .NET
    ASP.Net & Web Forms
    Custom Controls
    Web Development
    Exception Handling
    XML
    Database
    Security in .Net
    Testing
    Web Services
    Windows Services
    Windows Controls
    WCF
    AJAX
    WPF
    XAML
    Reporting
    Setup
    VB.Net
    LINQ
    JQuery
    SilverLight
    JavaScript
    HTML5
    Crystal Report
    Cloud Computing
    Share Point
    Visual C++
    MVC
    Android
    PHP
    Java
    HTML
    WordPress
    Joomla
    Products
    Drupal
    Windows Phone
    JSON
    LightSwitch
    iPhone/iPad
    Ruby on Rails
    IIS 7
    Windows 8
    CSS/CSS3
    Excel
    MS Access
    Shortcut Keys
    Visual SourceSafe
    Team Foundation Server
    API(s)
    Sencha-Touch
    Single Page App
    Bootstrap
Follow Us
Follow _MindStick_ on Twitter View MindStick Software's LinkedIn profile View MindStick Software's Facebook profile
Top Contributor
Advertisement
Advertise with Us
Mindstick
Article Article  Forum Forum  Blog Blog  Quiz Quiz  Beginner Beginner  Careers Careers  Contact Contact  Login Login  
Home | Product | Services | About Us | Interview | DeveloperSection | Submit an Article | Submit Blog

Home >> VB.Net >> OpenFileDialog Control in VB.Net
OpenFileDialog Control in VB.Net
OpenFileDialog Control in VB.Net


by Pushpendra Singh on 12/13/2010 4:43:24 PM

Views: 8377       Comments: 0

OpenFileDialog Control in VB.Net

A OpenFileDialog control is used to select a file. OpenFileDialog provide files to the user and retrieves the user's file selection back to the program

Drag and drop OpenFileDialog control from toolbox on the window Form.

OpenFileDialog Control in VB.Net

OpenFileDialog Control in VB.Net

Drag and drop PictureBox and a Button.

OpenFileDialog Control in VB.Net

Code:

 

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

        ' OpenFileDialog will open

        OpenFileDialog1.ShowDialog()

        ' OpenFileDialog will open this directory

        OpenFileDialog1.InitialDirectory = "c:\Libraries\Pictures"

        'selected Image will show in the pictureBox

        PictureBox1.Image = Image.FromFile(OpenFileDialog1.FileName)

        ' Image.FromFile Method Creates an Image from the specified file.

End Sub

Run the project

 

OpenFileDialog Control in VB.Net

When you click select image button then file file browser window will open.

OpenFileDialog Control in VB.Net

When you select file and click open then selected file will show in the PictureBox on the Form.

OpenFileDialog Control in VB.Net

 

 

 

Report Abuse Form
Reason:    
 

Title :
Comment :
Text ColorBackground Color
BoldItalicUnderline
LeftCenterRightJustify
Ordered ListBulleted List
IndentOutdent
Horizontal Rule
SubscriptSuperscript
HyperlinkImage
Design ModeDesign
View HtmlHtml
     
 
Latest Article by Pushpendra SinghRSS Feed
    
    
    
    
    
    
    
    
    
    
More...
Latest BlogsRSS Feed
    
    
    
    
    
    
    
    
    
    
More...
Top Viewed ArticlesRSS Feed
    
    
    
    
    
    
    
    
    
    
Top Viewed BlogsRSS Feed
    
    
    
    
    
    
    
    
    
    
Latest Interview QuestionsRSS Feed
    
    
    
    
    
    
    
    
    
    
More...
Total Online Users: 3667
Advertisement
MindStick Cleaner
Advertise with Us
  
Copyright © 2014MindStick. All Rights Reserved.