Access开发培训
网站公告
·Access专家课堂QQ群号:151711184    ·Access快速开发平台下载地址及教程    ·欢迎加入Access专家课堂微信群!    ·如何快速搜索本站文章|示例|资料    
您的位置: 首页 > 技术文章 > Access数据库-窗体/数据页

窗体中图片放大与缩小的制作

时 间:2007-06-16 00:00:00
作 者:褚玉春   ID:11  城市:上海  QQ:3002789054点击这里给麥田发消息
摘 要:窗体中图片放大与缩小的制作原理
正 文:

   实现图片的放大缩小可以通过改变图片的宽度和高度来实现,下面举例说明。

点击下载此附件

 

操作步骤:
     打开
ACCESS,新增一空白窗体,在窗体中添加一个图像控件,修改图片名称,设定图片来源,如下图:


    在窗体中添加两按钮,标题分别为“放大”,“缩小”,名称分别为
”cmdBigger”,”cmdSmaller”,为两按钮的单击事件编写代码如下:

Private Sub cmdBigger_Click()

 Dim intWidth As Integer

Dim intHeight As Integer

 

With Image2

    intWidth = .Width

    intHeight = .Height

 .Width = intWidth * 4.05

    .Height = intHeight * 4.05

    .SizeMode = acOLESizeZoom

End With

' Allow Access time to Repaint Screen

' since we have Autorepeat set to TRUE for

' this Command Button

DoEvents


End Sub

Private Sub cmdSmaller_Click()
Dim intWidth As Integer

Dim intHeight As Integer


With Image2

    intWidth = .Width

    intHeight = .Height


    .Width = intWidth / 1.05

    .Height = intHeight / 1.05

    .SizeMode = acOLESizeZoom

End With

' Allow Access time to Repaint Screen

' since we have Autorepeat set to TRUE for

' this Command Button

DoEvents


End Sub

 

保存运行即可!



Access软件网官方交流QQ群 (群号:483923997)       Access源码网店

常见问答:

技术分类:

相关资源:

专栏作家

关于我们 | 服务条款 | 在线投稿 | 友情链接 | 网站统计 | 网站帮助