DeleteFile
从PictureViewer中删除指定的图片文件。
语法:
DeleteFile(FileName)
FileName:要删除的图片文件名。
示例一
删除指定的图片文件:
Dim
pv
As
WinForm.PictureViewer
=
e.Form.Controls("PictureViewer1")
pv.DeleteFile("abc.jpg")
如果添加的图片文件包括路径,那么删除的时候,也必须包括路径:
Dim
pv
As WinForm.PictureViewer
= e.Form.Controls("PictureViewer1")
pv.DeleteFile("\photo\abc.jpg")
示例二
删除选定的图片文件:
Dim
pv As
WinForm.PictureViewer
= e.Form.Controls("PictureViewer1")
Dim
fl As
String = pv.SelectedItem
If
fl > ""
Then
pv.DeleteFile(fl)
End
If