Help with code

S

SF

Hi,

I have a VS2008 application form using Visual Basic. In one of the form, I
have a textbox (txtPath) and a button with the code below. When I try to
assign txtPath to a file select in OpenfileDialog I got a blue line
underline the code.


Imports System.Windows.Forms

Imports System.Windows.Forms.OpenFileDialog

Public Class ProposalManagement

Private Sub btnOpenFile_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles btnOpenFile.Click

Dim fdlg As OpenFileDialog = New OpenFileDialog()

fdlg.Title = "Select Document to files"

fdlg.InitialDirectory = "C:\"

fdlg.Filter = "All files (*.*)|*.*|All files (*.*)|*.*"

fdlg.FilterIndex = 2

fdlg.RestoreDirectory = True

If fdlg.ShowDialog = Windows.Forms.DialogResult.OK Then

Me.txtPath = fdlg.FileName <=== Error is here

End If


End Sub

End Class



SF
 
M

Mr. Arnold

SF said:
Hi,

I have a VS2008 application form using Visual Basic. In one of the form, I
have a textbox (txtPath) and a button with the code below. When I try to
assign txtPath to a file select in OpenfileDialog I got a blue line
underline the code.

Me.txtPath.Text = fdlg.FileName



__________ Information from ESET NOD32 Antivirus, version of virus signature database 4080 (20090515) __________

The message was checked by ESET NOD32 Antivirus.

http://www.eset.com
 
M

Mr. Arnold

SF said:
Hi,

I have a VS2008 application form using Visual Basic. In one of the form, I
have a textbox (txtPath) and a button with the code below. When I try to
assign txtPath to a file select in OpenfileDialog I got a blue line
underline the code.

Me.txtPath.Text = fdlg.FileName



__________ Information from ESET NOD32 Antivirus, version of virus signature database 4080 (20090515) __________

The message was checked by ESET NOD32 Antivirus.

http://www.eset.com
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top