Live-Forum - Die aktuellen Beiträge
Anzeige
Archiv - Navigation
1616to1620
Aktuelles Verzeichnis
Verzeichnis Index
Übersicht Verzeichnisse
Vorheriger Thread
Rückwärts Blättern
Nächster Thread
Vorwärts blättern
Anzeige
HERBERS
Excel-Forum (Archiv)
20+ Jahre Excel-Kompetenz: Von Anwendern, für Anwender
Inhaltsverzeichnis

shape drehen solange Mouse auf shape

shape drehen solange Mouse auf shape
13.04.2018 13:56:07
stef26
Hallo Liebe Excelprofis,
ich könnte mal schnell eure Hilfe gebrauchen.
Ich habe ein shape welches ich mit
ActiveSheet.Shapes("Gfk_Refresh").IncrementRotation 10
drehen lasse.
Den Auslöser hab ich auf auf ein durchsichtiges Steuerelement gelegt, welches über meinem Shape platziert ist:
Private Sub SMDON_MouseMove(ByVal Button As Integer, ByVal Shift As Integer, ByVal X As Single, ByVal Y As Single)
Ich habe es nun soweit, dass mein Shape um 10 dreht.
Wie bekomme ich es hin, das das Shape die Drehung wiederholt solange meine Maus auf dem Steuerelement/Shape liegt?
Gruß
Stefan

4
Beiträge zum Forumthread
Beiträge zu diesem Forumthread

Betreff
Datum
Anwender
Anzeige
alles dreht sich.ganz wichtige Sache ...oder? owT
13.04.2018 15:49:31
robert
AW: shape drehen solange Mouse auf shape
13.04.2018 15:55:18
ChrisL
Hi
Habe den Code aus dem nachstehenden Beitrag etwas verunstaltet:
https://www.mrexcel.com/forum/excel-questions/36613-need-help-mousemove-event.html
Shape = Rechteck 1
Steuerelement = Commandbutton1
Modul Tabelle:
Private Sub CommandButton1_MouseMove(ByVal Button As Integer, ByVal Shift As Integer, ByVal x  _
As Single, ByVal y As Single)
With CommandButton1
Call GetCursor(.Width, .Height, x, y, Me.OLEObjects("CommandButton1"))
End With
End Sub

Standardmodul:

Public Declare Function GetCursorPos Lib "user32" (lpPoint As _
POINTAPI) As Long
Dim z As POINTAPI ' Declare variable
Type POINTAPI
x As Long
y As Long
End Type
Type CursorMoveThreshHold
Left As Long
Right As Long
Top As Long
Bottom As Long
End Type
Sub GetCursor(intWidth As Long, intHeight As Long, intPosX As Single, intPosY As Single, ctl As  _
OLEObject)
Dim cmt As CursorMoveThreshHold
GetCursorPos z
cmt.Top = z.y - (1.35 * intPosY)
cmt.Bottom = z.y + (1.35 * (intHeight - intPosY))
cmt.Left = z.x - (1.35 * intPosX)
cmt.Right = z.x + (1.35 * (intWidth - intPosX))
Do
GetCursorPos z
DoEvents
If z.y  cmt.Bottom Or z.x  cmt.Right Then
Exit Sub
Else
ActiveSheet.Shapes("Rechteck 1").IncrementRotation 10
End If
Loop
End Sub
cu
Chris
Anzeige
AW: shape drehen solange Mouse auf shape
13.04.2018 16:04:40
Nepumuk
Hallo Stefan,
ich habe dir mal eine Beispielmappe erstellt. Über dem Bild liegt wie bei dir ein transparentes Label. Wenn du mit der Maus über die 20 Punkt großen Rand fährst, dann wird der Timer eingeschaltet, wenn du mit der Maus wieder über den Rand fährst wird der Timer ausgeschaltet.
https://www.herber.de/bbs/user/121038.xlsm
Gruß
Nepumuk
AW: shape drehen solange Mouse auf shape
17.04.2018 21:53:10
stef26
Vielen Dank für die beiden guten Ideen für mein Thema und sorry für die späte Rückmeldung.
Danke
Stefan

Links zu Excel-Dialogen

Beliebteste Forumthreads (12 Monate)

Anzeige

Beliebteste Forumthreads (12 Monate)

Anzeige
Anzeige
Anzeige