
Private Sub Image3_MouseDown(ByVal Button As Integer, ByVal Shift As Integer, ByVal x As Single, ByVal Y As Single) Me.Image3.Height = 150 Me.Image3.Width = 150 End Sub Private Sub Image3_MouseUp(ByVal Button As Integer, ByVal Shift As Integer, ByVal x As Single, ByVal Y As Single) Me.Image3.Height = 48 Me.Image3.Width = 48 |
'in un Modulo
Option Explicit
Private prev_img As String
Public Sub zoom_onoff()
ActiveSheet.Shapes(prev_img).Width = 150
With ActiveSheet.Shapes(Application.Caller)
If .Width >= 200 Then
.Width = 150
Else
.Width = 200
End If
End With
prev_img = Application.Caller
End Sub
|
for each v in activesheet.shapes: v.onaction="zoom_onoff": next
Option Explicit
Public WithEvents itmImage As Image
Public CallerObject As class_control_matrix
Private Sub itmImage_Click()
Dim s As String
If itmImage.Name = Range("AA1") Then
With itmImage
.Width = 50
.Height = 50
End With
CallerObject.ItemClick itmImage
Exit Sub
End If
If Range("AA1") = "" Then s = itmImage.Name Else s = Range("AA1")
With ActiveSheet.OLEObjects(s)
.Width = 50
.Height = 50
End With
With itmImage
If .Width >= 100 Then
.Width = 50
.Height = 50
Else
.Width = 100
.Height = 100
End If
End With
Range("AA1") = itmImage.Name
CallerObject.ItemClick itmImage
End Sub |
Private Sub Image21_MouseDown(ByVal Button As Integer, ByVal Shift As Integer, ByVal X As Single, ByVal Y As Single) Image21.Height = 150 Image21.Width = 150 End Sub Private Sub Image21_MouseUp(ByVal Button As Integer, ByVal Shift As Integer, ByVal X As Single, ByVal Y As Single) Image21.Height = 48 Image21.Width = 48 End Sub |
