Foxtable(狐表)用户栏目专家坐堂 → 求助 PictureViewer


  共有1809人关注过本帖树形打印复制链接

主题:求助 PictureViewer

帅哥哟,离线,有人找我吗?
有点色
  1楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:超级版主 帖子:13837 积分:69650 威望:0 精华:0 注册:2016/11/1 14:42:00
  发帖心情 Post By:2017/5/31 21:44:00 [显示全部帖子]

Dim dlg As New OpenFileDialog
Dim piv As WinForm.PictureViewer = e.Form.Controls("PictureViewer1")
dlg.Filter= "图形文件|*.bmp;*.jpg;*.gif"
dlg.MultiSelect = True
If dlg.ShowDialog = DialogResult.OK Then
    For Each file as string In dlg.FileNames
        Tables("表A").AddNew
        Dim pth As String = ProjectPath & "Attachments\"
        If file.ToLower.StartsWith(pth.ToLower) Then '如果文件来自Attachments目录
            piv.AddFile(file.SubString(pth.Length))
        Else '如果不是
            FileSys.CopyFile(file, pth & FileSys.GetName(file))
            piv.AddFile(FileSys.GetName(file))
        End If
    Next
End If

 回到顶部