Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 214
  • Last Modified:

executing a openfiledialog box in vb.net

Hi,
 can someone show me the open file dialog box execution thats tied with a button say button1_Onclick?

Thanks
0
LuckyLucks
Asked:
LuckyLucks
2 Solutions
 
TorrwinCommented:
Here's one that I used to open up a Crystal Report:

Private Sub btnReportsOpen_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnReportsOpen.Click
        Dim dgrResult As DialogResult
        Dim myFile As String

        dlgOpen.InitialDirectory = Application.StartupPath & "\Reports"
        dlgOpen.Filter = ".rpt|*.rpt"
        dgrResult = dlgOpen.ShowDialog()
        If dgrResult <> DialogResult.Cancel Then
            myFile = dlgOpen.FileName
            rptTest.ReportSource = myFile
            rptTest.RefreshReport()
            UpdateMRU(myFile)
        End If
    End Sub

0
 
Éric MoreauSenior .Net ConsultantCommented:
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now