Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 57
Default MouseMove & Click event over an image control

hi all,

this is my problem:

Inside an excel sheet userform i've put some images (control.Image)
When the form is activated dragging the mouse over a single image i
change the image itself switching between 4 different .bmp files
according to mouse position over the active control. (this works fine).
the problem is when i casually click over the image. An unwanted event
is generated and the image is "locked", even moving the mouse there's
no possibility to visualize other images related to the active control.
is like an unwanted event related to clicking is generated

How can i solve thise huge problem'?

thanks to all. fulvio

here you have some code...

orient1, orient2 etc are images
orientation is the routine switching the images
Private Sub orient2_MouseMove(ByVal Button As Integer, ByVal Shift As
Integer, ByVal X As Single, ByVal Y As Single)
Dim i As Integer
i = 2
Call orientation(X, Y, i)
End Sub

Private Sub orient3_MouseMove(ByVal Button As Integer, ByVal Shift As
Integer, ByVal X As Single, ByVal Y As Single)
Dim i As Integer
i = 3
Call orientation(X, Y, i)

End Sub


Private Sub orientation(X, Y, i)
Dim left, left1, left2, left3, left4 As Integer
Dim picture As String

picture = Worksheets("foglio1").Range("Az" & i).Value

Select Case Worksheets("foglio1").Range("Az" & i).Value

Case "terz dx"

left1 = 0
left2 = 16
left3 = 32
left4 = 48

If X < left2 Then
lineup.Controls("orient" & i).picture = LoadPicture("C:\Documents and
Settings\furbiuzzu\Desktop\immagini mytym\" & picture & " norm.bmp")
lineup.Controls("orient" & i).ControlTipText = "norm"
End If
If X = left2 And X < left3 Then
lineup.Controls("orient" & i).picture = LoadPicture("C:\Documents and
Settings\furbiuzzu\Desktop\immagini mytym\" & picture & " dif.bmp")
lineup.Controls("orient" & i).ControlTipText = "dif"
End If
If X = left3 And X < left4 Then
lineup.Controls("orient" & i).picture = LoadPicture("C:\Documents and
Settings\furbiuzzu\Desktop\immagini mytym\" & picture & " off.bmp")
lineup.Controls("orient" & i).ControlTipText = "off"
End If
If X = left4 Then
lineup.Controls("orient" & i).picture = LoadPicture("C:\Documents and
Settings\furbiuzzu\Desktop\immagini mytym\" & picture & " TM.bmp")
'lineup.Controls("orient" & i).ControlTipText = "tm"
If i 4 Then
lineup.Controls("orient" & i).ControlTipText = "ext"
Else
lineup.Controls("orient" & i).ControlTipText = "tm"
End If
End If

Case "terz sx"

left1 = 0
left2 = 16
left3 = 32
left4 = 48

If X < left2 Then
lineup.Controls("orient" & i).picture = LoadPicture("C:\Documents and
Settings\furbiuzzu\Desktop\immagini mytym\" & picture & " tm.bmp")
'lineup.Controls("orient" & i).ControlTipText = "tm"
If i 4 Then
lineup.Controls("orient" & i).ControlTipText = "ext"
Else
lineup.Controls("orient" & i).ControlTipText = "tm"
End If
End If
If X = left2 And X < left3 Then
lineup.Controls("orient" & i).picture = LoadPicture("C:\Documents and
Settings\furbiuzzu\Desktop\immagini mytym\" & picture & " dif.bmp")
lineup.Controls("orient" & i).ControlTipText = "dif"
End If
If X = left3 And X < left4 Then
lineup.Controls("orient" & i).picture = LoadPicture("C:\Documents and
Settings\furbiuzzu\Desktop\immagini mytym\" & picture & " off.bmp")
lineup.Controls("orient" & i).ControlTipText = "off"
End If
If X = left4 Then
lineup.Controls("orient" & i).picture = LoadPicture("C:\Documents and
Settings\furbiuzzu\Desktop\immagini mytym\" & picture & " norm.bmp")
lineup.Controls("orient" & i).ControlTipText = "norm"
End If

Case "dc dx"

left1 = 0
left2 = 20
left3 = 44

If X < left2 Then
lineup.Controls("orient" & i).picture = LoadPicture("C:\Documents and
Settings\furbiuzzu\Desktop\immagini mytym\" & picture & " ext.bmp")
If i 4 Then
lineup.Controls("orient" & i).ControlTipText = "tm"
Else
lineup.Controls("orient" & i).ControlTipText = "ext"
End If
End If
If X = left2 And X < left3 Then
lineup.Controls("orient" & i).picture = LoadPicture("C:\Documents and
Settings\furbiuzzu\Desktop\immagini mytym\" & picture & " off.bmp")
lineup.Controls("orient" & i).ControlTipText = "off"
End If
If X = left3 Then
lineup.Controls("orient" & i).picture = LoadPicture("C:\Documents and
Settings\furbiuzzu\Desktop\immagini mytym\" & picture & " norm.bmp")
lineup.Controls("orient" & i).ControlTipText = "norm"
End If

Case "dc sx"

left1 = 0
left2 = 20
left3 = 44

If X < left2 Then
lineup.Controls("orient" & i).picture = LoadPicture("C:\Documents and
Settings\furbiuzzu\Desktop\immagini mytym\" & picture & " norm.bmp")
lineup.Controls("orient" & i).ControlTipText = "norm"
End If
If X = left2 And X < left3 Then
lineup.Controls("orient" & i).picture = LoadPicture("C:\Documents and
Settings\furbiuzzu\Desktop\immagini mytym\" & picture & " off.bmp")
lineup.Controls("orient" & i).ControlTipText = "off"
End If
If X = left3 Then
lineup.Controls("orient" & i).picture = LoadPicture("C:\Documents and
Settings\furbiuzzu\Desktop\immagini mytym\" & picture & " ext.bmp")
If i 4 Then
lineup.Controls("orient" & i).ControlTipText = "tm"
Else
lineup.Controls("orient" & i).ControlTipText = "ext"
End If
End If

Case "att dx"

left1 = 0
left2 = 20
left3 = 44

If X < left2 Then
lineup.Controls("orient" & i).picture = LoadPicture("C:\Documents and
Settings\furbiuzzu\Desktop\immagini mytym\" & picture & " ext.bmp")
lineup.Controls("orient" & i).ControlTipText = "ext"
End If
If X = left2 And X < left3 Then
lineup.Controls("orient" & i).picture = LoadPicture("C:\Documents and
Settings\furbiuzzu\Desktop\immagini mytym\" & picture & " dif.bmp")
lineup.Controls("orient" & i).ControlTipText = "dif"
End If
If X = left3 Then
lineup.Controls("orient" & i).picture = LoadPicture("C:\Documents and
Settings\furbiuzzu\Desktop\immagini mytym\" & picture & " norm.bmp")
lineup.Controls("orient" & i).ControlTipText = "norm"
End If

Case "att sx"

left1 = 0
left2 = 20
left3 = 44

If X < left2 Then
lineup.Controls("orient" & i).picture = LoadPicture("C:\Documents and
Settings\furbiuzzu\Desktop\immagini mytym\" & picture & " norm.bmp")
lineup.Controls("orient" & i).ControlTipText = "norm"
End If
If X = left2 And X < left3 Then
lineup.Controls("orient" & i).picture = LoadPicture("C:\Documents and
Settings\furbiuzzu\Desktop\immagini mytym\" & picture & " dif.bmp")
lineup.Controls("orient" & i).ControlTipText = "dif"
End If
If X = left3 Then
lineup.Controls("orient" & i).picture = LoadPicture("C:\Documents and
Settings\furbiuzzu\Desktop\immagini mytym\" & picture & " ext.bmp")
lineup.Controls("orient" & i).ControlTipText = "ext"
End If

End Select

End Sub

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 57
Default MouseMove & Click event over an image control

uuhuhuhuhuh

really sorry for replying to my own post.....

acn anybody help me....

really need to solve this "bug"

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
call a function on control click event tkraju via OfficeKB.com Excel Discussion (Misc queries) 7 August 25th 06 07:22 AM
DTPicker Control: Can you programatically fire the click event? [email protected] Excel Programming 0 April 24th 06 10:37 PM
Why does the click event get control? Lee Hunter Excel Programming 1 October 31st 05 06:26 PM
Chart - display point details on MouseMove event mangesh_yadav[_30_] Excel Programming 5 July 27th 04 03:09 PM
Click on Image Control disables it Wexler Excel Programming 0 October 7th 03 05:35 PM


All times are GMT +1. The time now is 11:08 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"