ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   worksheet image control appearance change (and back) with mousemov (https://www.excelbanter.com/excel-programming/340025-worksheet-image-control-appearance-change-back-mousemov.html)

David

worksheet image control appearance change (and back) with mousemov
 
The user makes a choice by clicking on one of a number of small image
controls. I thought it would be nice if the image appearance could be changed
with mousemove (and now for the difficult bit) and changed back when the
mouse is moved away. Maybe using additional image control(s) bordering the
original image to change the original image appearance back to it's default
state?
TIA
--
David

K Dales[_2_]

worksheet image control appearance change (and back) with mousemov
 
Your idea can work: here is a simple demo; Image1 is a blank image control
just slightly larger than Image2, forming a small "frame" around it:

Private Sub Image1_MouseMove(ByVal Button As Integer, ByVal Shift As
Integer, ByVal X As Single, ByVal Y As Single)
Range("A1").Clear
End Sub

Private Sub Image2_MouseMove(ByVal Button As Integer, ByVal Shift As
Integer, ByVal X As Single, ByVal Y As Single)
Range("A1").Value = "IMAGE"
End Sub

You can see that A1 responds to the image while the mouse is over it and
clears when you move away (i.e. when you move over Image1). You could
replace the code within the subs: Sub Image2_MouseMove() could use the image
control properties to highlight Image2 in whatever way you decide and then
Image1_MouseMove() would reset it to the default state.
--
- K Dales


"David" wrote:

The user makes a choice by clicking on one of a number of small image
controls. I thought it would be nice if the image appearance could be changed
with mousemove (and now for the difficult bit) and changed back when the
mouse is moved away. Maybe using additional image control(s) bordering the
original image to change the original image appearance back to it's default
state?
TIA
--
David



All times are GMT +1. The time now is 09:18 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com