Forum: PC-Programmierung #Excel VBA > ändern eines Bildes in einem Event


You were forwarded to this site from EmbDev.net. Back to EmbDev.net
von Jan H. (janiiix3)


Lesenswert?

Guten Morgen =)

ich bin am verzweifeln.
Wieso kann ich in einem Event
1
Public Sub Image1_MouseDown(ByVal Button As Integer, ByVal Shift As Integer, ByVal X As Single, ByVal Y As Single)
2
    SetPicture Image1
3
End Sub
1
Private Sub SetPicture(imgObject As Image)
2
3
    MsgBox iPicCnt
4
5
  Dim sPicFile As Variant
6
7
  sPicFile = Application.GetOpenFilename _
8
    ("Pictures (*.gif; *.jpg; *.bmp; *.tif; *.jxr), *.gif; *.jpg; *.bmp; *.tif; *.jxr", _
9
    , "Bild auswählen")
10
    
11
   imgObject.Picture = LoadPicture(sPicFile)
12
   imgObject.PictureSizeMode = fmPictureSizeModeStretch
13
14
End Sub

Kein Bild aktualisieren?
Außerhalb des Events funktioniert es wunderbar..

: Bearbeitet durch User
Bitte melde dich an um einen Beitrag zu schreiben. Anmeldung ist kostenlos und dauert nur eine Minute.
Bestehender Account
Schon ein Account bei Google/GoogleMail? Keine Anmeldung erforderlich!
Mit Google-Account einloggen
Noch kein Account? Hier anmelden.