ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   LoadPicture fails (https://www.excelbanter.com/excel-programming/426981-loadpicture-fails.html)

kirkm[_8_]

LoadPicture fails
 
Hi,

I have an image control on a Form and load the pictures with
the command:

Form1.img1.Picture = LoadPicture(MyPicture)

A click on the form correctly assigns the
next picture filename (and Path) to MyPicture and you see each picture
in succession.

However, if the image is clicked on, the next picture(s) isn't shown.
The code still executes, with all the correct parameters for MyPicture
but the LoadPicture instruction just seems to be ignored. I can step
through and see this, and it occurs every time.

There's no click event (or anything else) coded for the img1 control.

Anyone know what's happening here? !!

Thanks - Kirk

Peter T

LoadPicture fails
 
after loading the picture do

Me.Repaint

Regards,
Peter T

<kirkm wrote in message ...
Hi,

I have an image control on a Form and load the pictures with
the command:

Form1.img1.Picture = LoadPicture(MyPicture)

A click on the form correctly assigns the
next picture filename (and Path) to MyPicture and you see each picture
in succession.

However, if the image is clicked on, the next picture(s) isn't shown.
The code still executes, with all the correct parameters for MyPicture
but the LoadPicture instruction just seems to be ignored. I can step
through and see this, and it occurs every time.

There's no click event (or anything else) coded for the img1 control.

Anyone know what's happening here? !!

Thanks - Kirk




kirkm[_8_]

LoadPicture fails
 
On Thu, 16 Apr 2009 12:45:07 +0100, "Peter T" <peter_t@discussions
wrote:

after loading the picture do

Me.Repaint

Regards,
Peter T


Thanks for the suggestion, Peter. I ttried that
and also a 'full path'
frmOne.img1.Picture.Repaint

.... but neither make any difference. It does
seem odd. I'm going to make a new workbook
with just that routine by itself. Maybe you
could run that and see what you get? Perhaps I'm
making a mistake somehow that's causing the glitch.

Cheers - Kirk

kirkm[_8_]

LoadPicture fails
 
On Thu, 16 Apr 2009 12:45:07 +0100, "Peter T" <peter_t@discussions
wrote:

after loading the picture do

Me.Repaint

Regards,
Peter T


Peter, you're quite right - thank you.

Originally I could get this to work but it does now!

Cheers - Kirk


All times are GMT +1. The time now is 10:38 AM.

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