高手帮忙!

stephenz2 2000-08-15 11:37:00
这是我写的一段代码:
If (txtread中的页数> 1) Then
txtread.Refresh
Call BitBlt(Picture1(0).hDC, 0, 0, txtread.Width, txtread.Height, txtreaddc, 0, 0, SRCCOPY)
txtread.SetFocus
SendKeys "{pgdn}"
For page = 1 To txtread中的页数
If (page Mod 2 = 0) Then

txtread.SetFocus
SendKeys "{pgdn}"
txtread.Refresh
Load Picture1(page)
Picture1(page).AutoRedraw = True
Picture1(page).Visible = False
Picture1(page).Left = 120
Picture1(page).Top = 120
Picture1(page).Width = 3375
Picture1(page).Height = 6375
Call BitBlt(Picture1(page).hDC, 0, 0, txtread.Width, txtread.Height, txtreaddc, 0, 0, SRCCOPY)
Picture1(page).Refresh
Else
txtread.SetFocus
SendKeys "{pgdn}"
txtread.Refresh
Load Picture1(page)
Picture1(page).AutoRedraw = True
Picture1(page).Left = 3720
Picture1(page).Top = 120
Picture1(page).Width = 3375
Picture1(page).Height = 6375
If (page = 1) Then
Picture1(page).Visible = True
Else
Picture1(page).Visible = False
End If
Call BitBlt(Picture1(page).hDC, 0, 0, txtread.Width, txtread.Height, txtreaddc, 0, 0, SRCCOPY)
Picture1(page).Refresh
End If
Next page
Else
txtread.Refresh
Call BitBlt(Picture1(0).hDC, 0, 0, txtread.Width, txtread.Height, txtreaddc, 0, 0, SRCCOPY)
End If
txtread.Visible = False

我本来想的是把一个textbox(代码中命名为txtread)分页输出到几个Picturebox(代码中命名为picture1() )中,可是试来试去,几个picturebox中所拷贝的内容都是第一页(也就是没按PageDown时)的内容,请高手帮我检查一下,
谢谢!
...全文
64 1 打赏 收藏 转发到动态 举报
写回复
用AI写文章
1 条回复
切换为时间正序
请发表友善的回复…
发表回复
Un1 2000-08-15
  • 打赏
  • 举报
回复
把SendKeys "{pgdn}"放到for...next里面。另外最好使用selstart设置,不要用sendkeys

742

社区成员

发帖
与我相关
我的任务
社区描述
VB 版八卦、闲侃,联络感情地盘,禁广告帖、作业帖
社区管理员
  • 非技术类社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧