Hello! i'm having difficulties with "File is being used by another process.." and this is all the code i've got in my form:
Code:
Public Class Form1 Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load picture.Image = Image.FromFile(Application.StartupPath + "\boots\0000.BMP") End Sub Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim filename Dim ehsen As String dlgOpen.ShowDialog() filename = dlgOpen.FileName picture.Image = Image.FromFile(filename) 'u?itavanje slike FileCopy(dlgOpen.FileName, Application.StartupPath + "\boots\0000.BMP") 'kopiranje u?itane slike u odre?eni direktorij End Sub Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click Form2.Show() End Sub End Class
and one more thing, when i remove [which i cant remove for final exe because i need this] this code:
Code:
picture.Image = Image.FromFile(Application.StartupPath + "\boots\0000.BMP")
it doesent show error, but i repeat, i need to use this function to load file after your run exe !
Code:
Public Class Form1 Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load picture.Image = Image.FromFile(Application.StartupPath + "\boots\0000.BMP") End Sub Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim filename Dim ehsen As String dlgOpen.ShowDialog() filename = dlgOpen.FileName picture.Image = Image.FromFile(filename) 'u?itavanje slike FileCopy(dlgOpen.FileName, Application.StartupPath + "\boots\0000.BMP") 'kopiranje u?itane slike u odre?eni direktorij End Sub Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click Form2.Show() End Sub End Class
and one more thing, when i remove [which i cant remove for final exe because i need this] this code:
Code:
picture.Image = Image.FromFile(Application.StartupPath + "\boots\0000.BMP")
it doesent show error, but i repeat, i need to use this function to load file after your run exe !