05-01-19, 10:59 AM
السلام عليكم ورحمه الله وبركاته
تحية للاعضاء الكرام
اولا : - الكود التالى خاص بحذف الصورة من مسار البرنامج
PbPic.Image.Dispose()
Dim FileDelete As String = (Application.StartupPath & "\Mypicture\" & txtItemID.Text & ".jpg")
If System.IO.File.Exists(FileDelete) Then
System.IO.File.Delete(FileDelete)
End If
حيث ان
(1) PbPic هو اسم PictureBox
(2) Mypicture هو اسم مجلد الصور فى مسار البرنامج
(3) txtItemID هو اسم التكست بوكس لاسم الصورة فى النموذج المستخدم
(4) PbPic.Image.Dispose هو اجراء لتفريغ ال PictureBox
___________________________________________________________________________________________________________________
ثانيا : - الكود التالى خاص باضافة الصورة الجديدة المعدلة للصنف بنفس مسار الصور
Dim MYPicPhath As String
IO.File.Copy(MYPicPhath, Application.StartupPath & "\Mypicture\" & txtItemID.Text & ".jpg")
MYPicPhath = Application.StartupPath & "\Mypicture\" & txtItemID.Text & ".jpg"
txtMyPicPath.Text = MYPicPhath
ان شاء الله يمشى معاك الحال
تحياتى
تحية للاعضاء الكرام
اولا : - الكود التالى خاص بحذف الصورة من مسار البرنامج
PbPic.Image.Dispose()
Dim FileDelete As String = (Application.StartupPath & "\Mypicture\" & txtItemID.Text & ".jpg")
If System.IO.File.Exists(FileDelete) Then
System.IO.File.Delete(FileDelete)
End If
حيث ان
(1) PbPic هو اسم PictureBox
(2) Mypicture هو اسم مجلد الصور فى مسار البرنامج
(3) txtItemID هو اسم التكست بوكس لاسم الصورة فى النموذج المستخدم
(4) PbPic.Image.Dispose هو اجراء لتفريغ ال PictureBox
___________________________________________________________________________________________________________________
ثانيا : - الكود التالى خاص باضافة الصورة الجديدة المعدلة للصنف بنفس مسار الصور
Dim MYPicPhath As String
IO.File.Copy(MYPicPhath, Application.StartupPath & "\Mypicture\" & txtItemID.Text & ".jpg")
MYPicPhath = Application.StartupPath & "\Mypicture\" & txtItemID.Text & ".jpg"
txtMyPicPath.Text = MYPicPhath
ان شاء الله يمشى معاك الحال
تحياتى
