Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
Dim tmpFilename As String
Dim FileToCopy As String
Dim NewCopy As String
tmpFilename = txtPicLink.Text
OpenFileDialog1.InitialDirectory() = txtPicLink.Text
OpenFileDialog1.FileName = txtPicLink.Text
OpenFileDialog1.ShowDialog()
txtPicLink.Text = OpenFileDialog1.FileName
If MessageBox.Show("Do you to change picture?", "System Admin", MessageBoxButtons.YesNo, MessageBoxIcon.Question) = Windows.Forms.DialogResult.No Then
txtPicLink.Text = tmpFilename
Else
'Me.PicComponentPartList.Image = Image.FromFile(txtPicLink.Text)
Me.PicComponentPartList.Load(txtPicLink.Text)
FileToCopy = txtPicLink.Text
NewCopy = "\\sed32\ForShare\" & Me.txtComponentPartListID.Text & ".jpg"
' redrawImage()
If System.IO.File.Exists(FileToCopy) = True Then
System.IO.File.Copy(FileToCopy, NewCopy, True) 'ถ้ามีไฟล์เก่าให้ Copy (True) ทับเลย
MsgBox("Load Picture Completed !!")
End If
txtPicLink.Text = NewCopy
End If
End Sub