如题。我看过别人的一些代码,大多是将PictureBox的边框进行缩放,而不是我想要的边框不变,而是控件装载图形的放大、缩小和平移,并且在平移的时候鼠标能呈现一只小手形状。
解决方案 »
- 嵌套结构体赋值出错!提示:未将对象引用设置到对象的实例
- 关于用SQL语句增加列,怎么把列的名称命名为今天的日期
- datareport 预览
- 动态向一个ACCESS数据库(info.mdb)表(type)里添加一个字段strtepm,如何设置该字段为“允许空字符串“并且默认值为""
- 如何在datagrid控件的列中加入复选按钮或下拉列表?
- 急!请高手们帮我解决这个关于菜单的问题。
- 200分!!access数据库中有一字段‘项目’,用ado确定一个记录源,我要测试每条记录的长度,但是如果数据库中有一条记录的该字段的值为空
- 程序卸载问题
- 这问题已有一年了----关于vsflexgrid7.0问题
- 有些人的回答总是不痛不痒,希望得到意外之分,我讨厌这样滥竽充数的人...
- 怎样读ini一个小节的所有项到一个combox中去
- 用 picturebox显示图片效果差是什么原因?
你拉大这个控件的时候,它的图片会自动增大的.
Dim iy As LongPrivate Sub Form_Load()
Image1.Left = 0
Image1.Top = 0
End SubPrivate Sub Image1_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
Me.MousePointer = 15
If Button = vbLeftButton Then
ix = X
iy = Y
Else: PopupMenu zoom
End If
End SubPrivate Sub Image1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
Dim ipx As Long
Dim ipy As Long
If Button = vbLeftButton Then
ipx = Image1.Left + X - ix
ipy = Image1.Top + Y - iy
If ipx > 0 Then
Image1.Left = 0
Else
If ipx < Picture1.Width - Image1.Width Then
ipx = Picture1.Width - Image1.Width
Else
Image1.Left = ipx
End If
End If
If ipy > 0 Then
Image1.Top = 0
Else
If ipy < Picture1.Height - Image1.Height Then
ipy = Picture1.Height - Image1.Height
Else
Image1.Top = ipy
End If
End If
End If
End SubPrivate Sub Image1_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
Me.MousePointer = 0
End Sub
Private Sub zoomin_Click()
Image1.Width = Image1.Width / 2
Image1.Height = Image1.Height / 2
End SubPrivate Sub zoomout_Click()
Image1.Width = Image1.Width * 2
Image1.Height = Image1.Height * 2
End Sub
我找到了这样的图标,并且设置img.DragIcon属性为小手图标,为什么在拖动的时候不出现呢?
我设置Me.MousePointer = 99
并且设置了Me.MouseIcon 为小手图标。