Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 226
Default Conditionally load picture woes

Hi there

I have run across a problem that has me stumped and I have spent the
last few days tinkering about trying to find out how get it to work
but to no avail so I have been trudging around the news groups trying
to find an answer and again I have come up empty handed and I am
starting to feel like this idea has a grudge against me.

Anywho my problem is thus I am trying to emulate the a mouse over
effect that can been seen in MS Media Player 11 when the mouse is
moved over an area a button appears and when you click the area
changes colour to show that button is the current selection, this is
easy enough to achieve but my problem is that when you move the mouse
over that selected button it will highlight the button to show a mouse
over effect.

Does anyone know anyway to conditionally load an image into an image
control? i.e

Private Sub Image1_MouseMove(ByVal Button As Integer, ByVal Shift As
Integer, ByVal X As Single, ByVal Y As Single)
If Image1. picture = mypicture1.bmp then 'this bit seems to be the one
giving me the problems I can't figure out how to determine which .bmp
file is actually loaded.
Image1.picture = loadpicture("c:\somefolder\somepicture.bmp")
Else
Image1.picture = loadpicture("c:\somefolder\someotherpicture.bmp")
End if
End sub

Any help would be very gratefully appreciated as this is starting to
become my nemesis as I'm sure it will turn out to be something simple
that I just haven't thought of.

Thanks

S

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,441
Default Conditionally load picture woes

I think you need to store the image name to be able to work with it: I'm not sure of the logic you
want to use for changing the picture, but.... Also, you may need additional control to prevent
refiring and quick changes of the picture.

Dim myImage As String

Private Sub Image1_MouseMove(ByVal Button As Integer, _
ByVal Shift As Integer, ByVal X As Single, ByVal Y As Single)

If myImage = "" Then
Image1.Picture = LoadPicture("c:\somefolder\somepicture.bmp")
myImage = "c:\somefolder\somepicture.bmp"
Exit Sub
End If

If myImage = "c:\somefolder\somepicture.bmp" Then
Image1.Picture = LoadPicture("c:\somefolder\someotherpicture.bmp")
myImage = "c:\somefolder\someotherpicture.bmp"
Else
Image1.Picture = LoadPicture("c:\somefolder\somepicture.bmp")
myImage = "c:\somefolder\somepicture.bmp"
End If
End Sub

HTH,
Bernie
MS Excel MVP


"Incidental" wrote in message
ups.com...
Hi there

I have run across a problem that has me stumped and I have spent the
last few days tinkering about trying to find out how get it to work
but to no avail so I have been trudging around the news groups trying
to find an answer and again I have come up empty handed and I am
starting to feel like this idea has a grudge against me.

Anywho my problem is thus I am trying to emulate the a mouse over
effect that can been seen in MS Media Player 11 when the mouse is
moved over an area a button appears and when you click the area
changes colour to show that button is the current selection, this is
easy enough to achieve but my problem is that when you move the mouse
over that selected button it will highlight the button to show a mouse
over effect.

Does anyone know anyway to conditionally load an image into an image
control? i.e

Private Sub Image1_MouseMove(ByVal Button As Integer, ByVal Shift As
Integer, ByVal X As Single, ByVal Y As Single)
If Image1. picture = mypicture1.bmp then 'this bit seems to be the one
giving me the problems I can't figure out how to determine which .bmp
file is actually loaded.
Image1.picture = loadpicture("c:\somefolder\somepicture.bmp")
Else
Image1.picture = loadpicture("c:\somefolder\someotherpicture.bmp")
End if
End sub

Any help would be very gratefully appreciated as this is starting to
become my nemesis as I'm sure it will turn out to be something simple
that I just haven't thought of.

Thanks

S



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 226
Default Conditionally load picture woes

Hi Bernie

Thanks for the help it's much appreicated, i have been pulling my hair
out with this one... will give your code a run through as soon as i
get a chance thanks again

Steven

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
More RGB Woes Zone Excel Programming 3 August 19th 06 06:40 PM
Load picture from file to custom toolbar of Excel 2000 Padam Excel Programming 2 August 6th 06 05:58 AM
How can I conditionally display one picture over another? Arnold Reedy Excel Discussion (Misc queries) 1 February 5th 06 03:05 PM
Cannot load picture from file! David Avsajanishvili[_2_] Excel Programming 0 February 28th 05 01:09 AM
How to load a .bmp picture into a cell? Andrew Excel Programming 1 February 15th 05 04:25 AM


All times are GMT +1. The time now is 06:55 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"