PC Review


Reply
Thread Tools Rate Thread

Conditionally load picture woes

 
 
Incidental
Guest
Posts: n/a
 
      6th Mar 2007
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

 
Reply With Quote
 
 
 
 
Bernie Deitrick
Guest
Posts: n/a
 
      6th Mar 2007
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" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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
>



 
Reply With Quote
 
Incidental
Guest
Posts: n/a
 
      6th Mar 2007
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 With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
inserting picture woes (dimensions are wrong) =?Utf-8?B?U1dPT0Q=?= Microsoft Word Document Management 5 10th Oct 2007 03:34 AM
Dont want to go to FIREFOX!!! Increasing IE6 page load woes todd.roat@uc.edu Windows XP Internet Explorer 6 10th Mar 2006 08:58 PM
How can I conditionally display one picture over another? =?Utf-8?B?QXJub2xkIFJlZWR5?= Microsoft Excel Misc 1 5th Feb 2006 03:05 PM
down load picture but no picture =?Utf-8?B?am9obg==?= Windows XP Photos 2 3rd May 2004 01:54 AM
Re-install woes: CBrowserCtrl load fail and Repository read-only Mark K Vallevand Windows XP Embedded 4 1st Mar 2004 07:59 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 04:03 PM.