• 软件测试技术
  • 软件测试博客
  • 软件测试视频
  • 开源软件测试技术
  • 软件测试论坛
  • 软件测试沙龙
  • 软件测试资料下载
  • 软件测试杂志
  • 软件测试人才招聘
    暂时没有公告

字号: | 推荐给好友 上一篇 | 下一篇

Create a scrollable viewpoint

发布: 2007-6-21 21:57 | 作者:   | 来源:   | 查看: 14次 | 进入软件测试论坛讨论

领测软件测试网

   
  Create a scrollable viewpoint

Tip by Sam Huggill

Tip description

Use scrollbars and picture boxes to create a scollable picture viewer.

Tip Code

Private Sub HScroll1_Change()

Picture2.Left = -HScroll1.Value
End Sub

Private Sub VScroll1_Change()
Picture2.Top = -VScroll1.Value
End Sub

Private Sub Form_Resize()

With Picture1
  .Height = Form1.Height
  .Width = Form1.Width
End With

Picture1.Move 0, 0, ScaleWidth - VScroll1.Width, _
ScaleHeight - HScroll1.Height

Picture2.Move 0, 0

With HScroll1
  .Top = Picture1.Height
  .Left = 0
  .Width = Picture1.Width
  .Max = Picture2.Width - Picture1.Width
End With

With VScroll1
  .Top = 0
  .Left = Picture1.Width
  .Height = Picture1.Height
  .Max = Picture2.Height - Picture1.Height
End With

VScroll1.Visible = (Picture1.Height < Picture2.Height)
HScroll1.Visible = (Picture1.Width < Picture2.Width)

End Sub

Private Sub Form_Load()

Picture1.Move 0, 0, ScaleWidth - VScroll1.Width, _
ScaleHeight - HScroll1.Height

With Picture2
  .AutoSize = True
  .Picture = LoadPicture("d:vbcodeexamplesdemosanner.jpg")
  .Move 0, 0
End With

With HScroll1
  .Top = Picture1.Height
  .Left = 0
  .Width = Picture1.Width
End With

With VScroll1
  .Top = 0
  .Left = Picture1.Width
  .Height = Picture1.Height
End With

HScroll1.Max = Picture2.Width - Picture1.Width
VScroll1.Max = Picture2.Height - Picture1.Height
注释: HScroll1.LargeChange = HScroll1.Max / 10
注释: VScroll1.LargeChange = VScroll1.Max / 10

VScroll1.Visible = (Picture1.Height < Picture2.Height)
HScroll1.Visible = (Picture1.Width < Picture2.Width)

End Sub

文章来源于领测软件测试网 https://www.ltesting.net/


关于领测软件测试网 | 领测软件测试网合作伙伴 | 广告服务 | 投稿指南 | 联系我们 | 网站地图 | 友情链接
版权所有(C) 2003-2010 TestAge(领测软件测试网)|领测国际科技(北京)有限公司|软件测试工程师培训网 All Rights Reserved
北京市海淀区中关村南大街9号北京理工科技大厦1402室 京ICP备2023014753号-2
技术支持和业务联系:info@testage.com.cn 电话:010-51297073

软件测试 | 领测国际ISTQBISTQB官网TMMiTMMi认证国际软件测试工程师认证领测软件测试网