以文本方式查看主题 - Foxtable(狐表) (http://foxtable.com/bbs/index.asp) -- 专家坐堂 (http://foxtable.com/bbs/list.asp?boardid=2) ---- [分享][原创]列截图功能(解决)谢谢老师们 最后的代码有效 (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=88567) |
||||
-- 作者:yifan3429 -- 发布时间:2016/8/5 7:18:00 -- [分享][原创]列截图功能(解决)谢谢老师们 最后的代码有效 现在fox 有内置的截图功能 我现在有一个图片列 想直接再点击增加的时候就会出现截图功能 直接截图能行吗 哪里有案例 谢谢 解决代码如下 : If e.Col.name = "图片" Then baseMainForm.WindowState= Windows.forms.FormWindowState.Minimized(最小化) ClipBoard.Clear Dim proc As new Process proc.File = ApplicationPath & "/capture.exe" proc.WaitForClose = True proc.Start If ClipBoard.GetImage IsNot Nothing Then Dim f As String = e.Row("项目") & "\\" & "报价配图" & "\\"& Format( date.Today,"yyyy-MM-dd") & "/" & e.Row("产品名") & e.Row("工艺用材说明") & ".jpg" Dim path As String = e.Col.DataCol.DefaultFolder If path = "" Then path = ProjectPath & "Attachments/" End If basemainform.WindowState = 2(最大化) Dim dir As String = FileSys.GetParentPath(path & "/" & f) If FileSys.DirectoryExists(dir) = False Then FileSys.CreateDirectory(dir) ClipBoard.GetImage.save(path & "/" & f) e.Row(e.Col.name) = f End If e.cancel = True End If [此贴子已经被作者于2016/8/5 22:06:54编辑过]
|
||||
-- 作者:yifan3429 -- 发布时间:2016/8/5 8:13:00 -- 实例
|
||||
-- 作者:大红袍 -- 发布时间:2016/8/5 10:06:00 -- CellButtonClick事件
If e.Col.name = "截图功能" Then |
||||
-- 作者:yifan3429 -- 发布时间:2016/8/5 14:45:00 -- If e.Col.name = "图片" Then ClipBoard.Clear Dim proc As new Process proc.File = ApplicationPath & "/capture.exe" proc.WaitForClose = True proc.Start If ClipBoard.GetImage IsNot Nothing Then Select Case e.DataCol.Name Case "图片" e.SubFolder = dr("项目") & "\\" & "报价配图" & "\\"& Format( date.Today,"yyyy-MM-dd") Dim s As String = e.filename Dim Index As Integer = s.LastIndexOf(".") Dim hz As String = s.SubString(Index,s.length-Index) e.filename=e.DataRow("产品名") & e.DataRow("工艺用材说明")& hz SystemReady = True End Select End If e.cancel = True End If --------------------------- 提示 --------------------------- 找不到自定义函数"处理快捷键"! --------------------------- 确定 --------------------------- --------------------------- 错误 --------------------------- 编译错误:“DataCol”不是“RowColEventArgs”的成员。 错误代码:Select Case e.DataCol.Name --------------------------- 确定 --------------------------- 我改成这样不好使 需求 启动截屏时最小化项目 完成后 回到项目界面
[此贴子已经被作者于2016/8/5 14:46:12编辑过]
|
||||
-- 作者:大红袍 -- 发布时间:2016/8/5 14:57:00 -- If e.Col.name = "图片" Then ClipBoard.Clear Dim proc As new Process proc.File = ApplicationPath & "/capture.exe" proc.WaitForClose = True proc.Start If ClipBoard.GetImage IsNot Nothing Then Dim f As String = e.row("项目") & "\\" & "报价配图" & "\\"& Format( date.Today,"yyyy-MM-dd") & "/" & e.Row("产品名") & e.Row("工艺用材说明") & ".jpg" Dim path As String = e.Col.DataCol.DefaultFolder If path = "" Then path = ProjectPath & "Attachments/" End If Dim dir As String = FileSys.GetParentPath(path & "/" & f) If FileSys.DirectoryExists(dir) = False Then FileSys.CreateDirectory(dir) ClipBoard.GetImage.save(path & "/" & f) e.Row(e.Col.name) = f End If e.cancel = True End If |
||||
-- 作者:yifan3429 -- 发布时间:2016/8/5 20:46:00 -- 解决了 [此贴子已经被作者于2016/8/5 22:05:32编辑过]
|
||||
-- 作者:yifan3429 -- 发布时间:2016/8/6 8:17:00 -- If e.Col.name = "图片" Then baseMainForm.WindowState= Windows.forms.FormWindowState.Minimized ClipBoard.Clear Dim proc As new Process proc.File = ApplicationPath & "/capture.exe" proc.WaitForClose = True proc.Start If ClipBoard.GetImage IsNot Nothing Then Dim f As String = e.Row("项目") & "\\" & "报价配图" & "\\"& Format( date.Today,"yyyy-MM-dd") & "/" & e.Row("产品名") & ".png" Dim path As String = e.Col.DataCol.DefaultFolder If path = "" Then path = ProjectPath & "Attachments/" End If basemainform.WindowState = 2 Dim dir As String = FileSys.GetParentPath(path & "/" & f) If FileSys.DirectoryExists(dir) = False Then FileSys.CreateDirectory(dir) ClipBoard.GetImage.save(path & "/" & f) e.Row(e.Col.name) = f End If e.cancel = True End If Dim dr As DataRow = e.DataRow If dr.IsNull ("客户") Or Dr.IsNull("订单名称") Then MessageBox.show("本次结果,订单名称 主题列为必填项目","提示") e.cancel = True Else 上面针对于一个图片列 下面是一个表有多个图片列 我想请教简化后的代码如何写 不同的焦点 选择对应存储位置和存储条件 Select Case e.DataCol.Name Case "主要工艺" e.SubFolder = dr("文件编号") & "\\" & "主要工艺" & "\\" SystemReady = True Case "基层图" e.SubFolder = dr("文件编号") & "\\" & "基层图" & "\\"& Format( date.Today,"yyyy-MM-dd") SystemReady = True Case "效果图" e.SubFolder = dr("文件编号") & "\\" & "效果图" & "\\"& Format( date.Today,"yyyy-MM-dd") SystemReady = True Case "客来文件" e.SubFolder = dr("文件编号") & "\\" & "客来文件" & "\\"& Format( date.Today,"yyyy-MM-dd") SystemReady = True Case "设计文件" e.SubFolder = dr("文件编号") & "\\" & "设计文件" & "\\"& Format( date.Today,"yyyy-MM-dd") SystemReady = True Case "定稿文件" e.SubFolder = dr("文件编号") & "\\" & "定稿文件" & "\\"& Format( date.Today,"yyyy-MM-dd") SystemReady = True End Select End If
[此贴子已经被作者于2016/8/6 8:17:43编辑过]
|