求vfp中加6个按钮分别是让图片放大缩小左右上下移动的命令

来源:百度知道 编辑:UC知道 时间:2024/09/23 12:13:26
要格式对的呀

1、在VFP中新建一表单Form1,其属性设置:
Caption:改变图片的大小及位置
Height:400
Width:500
注:Height和Width也可根据自己的需要设置

2、在Form1中央添加图像控件Image1,其属性设置:
Picture:选择一个较小尺寸的图片,如128*128像素的图片
Stretch:2 - 变比填充

3、在Form1的一侧添加7个按钮控件Command1~Command7,其Caption属性依次为“放大”、“缩小”、“上移”、“下移”、“左移”、“右移”、“关闭”
Command1的Click代码:
thisform.image1.Width = thisform.image1.Width + 10
thisform.image1.Height = thisform.image1.Height + 10

Command2的Click代码:
thisform.image1.Width = thisform.image1.Width - 10
thisform.image1.Height = thisform.image1.Height - 10

Command3的Click代码:
thisform.image1.Top = thisform.image1.Top - 1

Command4的Click代码:
thisform.image1.Top = thisform.image1.Top + 1

Command5的Click代码:
thisform.image1.Left = thisform.image1.Left - 1

Command6的Click代码:
thisform.image1.Left = thisform.image1.Left + 1

Command7的Click代码:
thisform.Release