Hello,
I'm starting with VB 2005, I build a small and simple interface to teste what I'm learning but I've got an error when adding a invisible control to a form.
"InvalidOperationException was unhandled" saying this
File <make empty> is not a valid file name.
the code is like that:
" Public Class frmViewer
Private Sub btnSelectPicture_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSelectPicture.Click
'Show the open file dialog box.
If ofdSelectPicture.ShowDialog = Windows.Forms.DialogResult.OK Then
' Load the picture into the picture box.
picShowPicture.Image = Image.FromFile(ofdSelectPicture.FileName)
' Show the name of the file in te form's caption.
Me.Text = "picture Viewer (" & ofdSelectPicture.FileName & ")"
End If
End Sub
Private Sub btnQuit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnQuit.Click
' Close the window and exit the application
Me.Close()
End Sub
End Class"
can somebody help me please, I'm completely blind on this.
Thanks
João
I'm starting with VB 2005, I build a small and simple interface to teste what I'm learning but I've got an error when adding a invisible control to a form.
"InvalidOperationException was unhandled" saying this
File <make empty> is not a valid file name.
the code is like that:
" Public Class frmViewer
Private Sub btnSelectPicture_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSelectPicture.Click
'Show the open file dialog box.
If ofdSelectPicture.ShowDialog = Windows.Forms.DialogResult.OK Then
' Load the picture into the picture box.
picShowPicture.Image = Image.FromFile(ofdSelectPicture.FileName)
' Show the name of the file in te form's caption.
Me.Text = "picture Viewer (" & ofdSelectPicture.FileName & ")"
End If
End Sub
Private Sub btnQuit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnQuit.Click
' Close the window and exit the application
Me.Close()
End Sub
End Class"
can somebody help me please, I'm completely blind on this.
Thanks
João