LoadImage is an API, defined as:
HANDLE LoadImage(
HINSTANCE hinst, // handle to instance
LPCTSTR lpszName, // image to load
UINT uType, // image type
int cxDesired, // desired width
int cyDesired, // desired height
UINT fuLoad // load options
);
Methinks you want LoadPicture, a VB method, that loads an image from a
file...
Private Sub Picture1_Click()
static cnt as long
cnt=cnt+1
If cnt > 10 Then cnt = 1
Picture1.Picture=LoadPicture(somefilearrayofpictur es(cnt))
End If
End Sub
.... where somefilearrayofpictures() is a string array defining the files to
load, ie
'form general declarations
dim somefilearrayofpictures(1 to 10) as string
sub form_load
somefilearrayofpictures(1) = "c:\windows\somepix.bmp"
somefilearrayofpictures(2) = "c:\some\place\else\anotherpix.gif"
.... etc
--
Randy Birch
MVP Visual Basic
http://www.mvps.org/vbnet/
Please respond only to the newsgroups so all can benefit.
"werewolfie" <EMAIL REMOVED> wrote in message
news:3fc0d01e$0$15520$EMAIL REMOVED4al l.nl...
: Hi Group
:
: I'm kind of new to vb6 so forgive me any stupid questions
:
: I'm writing a little program that has a picture on it.
: I want to change the picture with this sub
:
: Private Sub Picture1_Click()
:
: For i = 1 To 10
:
: If i >= 10 Then i = 1
: LoadImage (i)
: next i
: End If
: End Sub
:
: Q 1: how do i declare 'i' as variable ?
: Q 2: i get a compile error with LoadImage, saying
: 'argument not optional'
:
: can or can't i use loadimage for this or should i think of using OLE or
: something else
:
: i've been searching everywhere from msdn to ms learn visual basic 6 but
: can't find it.
:
: Thanks
:
: Jos
:
: