以文本方式查看主题 - Foxtable(狐表) (http://foxtable.com/bbs/index.asp) -- 专家坐堂 (http://foxtable.com/bbs/list.asp?boardid=2) ---- 截图 (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=138193) |
-- 作者:nbsugu_z -- 发布时间:2019/7/25 8:14:00 -- 截图 basemainform.visible = False forms("小区录入窗口").visible=False Dim proc As new Process proc.File = ApplicationPath & "capture.exe" proc.WaitForClose = True proc.Start If ClipBoard.GetImage IsNot Nothing Then ClipBoard.GetImage.save(projectPath & "attachments/test.jpg") msgbox("保存到了") Dim ls = Tables("xqb").current.DataRow.lines("dt") ls.add("test.jpg") Tables("xqb").current.DataRow.lines("dt") = ls End If basemainform.visible = True forms("小区录入窗口").visible=True 老师请问一下上面代码有没有问题。click事件按下后想达到隐藏程序和当前窗口,然后能在屏幕上随意截图,保存后恢复窗口。我在测试时第一次是可以的,可是第二次就不会隐藏了,是什么问题
|
-- 作者:狐狸爸爸 -- 发布时间:2019/7/25 9:21:00 -- BaseMainForm.WindowState = FormWindowState.Minimized BaseMainForm.Hide() Application.DoEvents() 。。。 BaseMainForm.Show() BaseMainForm.WindowState = FormWindowState.Maximized |
-- 作者:nbsugu_z -- 发布时间:2019/7/25 9:48:00 -- 提示错误代码 |
-- 作者:nbsugu_z -- 发布时间:2019/7/25 9:52:00 -- 以下是引用狐狸爸爸在2019/7/25 9:21:00的发言:
BaseMainForm.WindowState = FormWindowState.Minimized BaseMainForm.Hide() Application.DoEvents() 。。。 BaseMainForm.Show() BaseMainForm.WindowState = FormWindowState.Maximized BaseMainForm.WindowState = FormWindowState.Minimized BaseMainForm.Hide() Application.DoEvents() basemainform.visible = False forms("小区录入窗口").visible=False Dim proc As new Process proc.File = ApplicationPath & "capture.exe" proc.WaitForClose = True proc.Start If ClipBoard.GetImage IsNot Nothing Then ClipBoard.GetImage.save(projectPath & "attachments/test.jpg") msgbox("保存到了") Dim ls = Tables("xqb").current.DataRow.lines("dt") ls.add("test.jpg") Tables("xqb").current.DataRow.lines("dt") = ls End If basemainform.visible = True forms("小区录入窗口").visible=True BaseMainForm.Show() BaseMainForm.WindowState = FormWindowState.Maximized 提示错误代码!
|
-- 作者:狐狸爸爸 -- 发布时间:2019/7/25 10:40:00 -- 在foxtable用,要加上前缀: System.Windows.Forms.FormWindowState.Minimized |
-- 作者:nbsugu_z -- 发布时间:2019/7/25 10:43:00 -- 代码提示错误在保存时 BaseMainForm.WindowState = FormWindowState.Minimized BaseMainForm.Hide() Application.DoEvents() basemainform.visible = False forms("小区录入窗口").visible=False Dim proc As new Process proc.File = ApplicationPath & "capture.exe" proc.WaitForClose = True proc.Start If ClipBoard.GetImage IsNot Nothing Then ClipBoard.GetImage.save(projectPath & "attachments/test.jpg") msgbox("保存到了") Dim ls = Tables("xqb").current.DataRow.lines("dt") ls.add("test.jpg") Tables("xqb").current.DataRow.lines("dt") = ls End If basemainform.visible = True forms("小区录入窗口").visible=True BaseMainForm.Show() BaseMainForm.WindowState = FormWindowState.Maximized
|
-- 作者:有点蓝 -- 发布时间:2019/7/25 11:21:00 -- BaseMainForm.WindowState = System.Windows.Forms.FormWindowState.Minimized |