I have this portion of code:
ReDim IMG_TB(0 To vtotfot - 1, vPaginas)
vpct = 0
vpag = 0
For vi = 0 To NPOS_01.GRD_FOTOS.Rows - 1
NPOS_01.GRD_FOTOS.Row = vi
NPOS_01.GRD_FOTOS.Col = 0
IMG_TB(vpct, vpag).Picture = LoadPicture(NPOS_01.FIL_FOTOS.Path & "\" &
NPOS_01.GRD_FOTOS.Text)
vpct = vpct + 1
If vpct = 30 Then
vpct = 0
vpag = vpag + 1
End If
Next
where NPOS_01 is a form containig a flex grid named GRD_FOTOS. The plan here
is to build a form acting as thumbnail window to display 29 pictures per
page using command buttons to switch page using for that purpose an integer
variable called vpage which in the beguining will be 0 (page 0) and after
pression the buttons Next will increment vpage by 1, and pressing Previous
will decrease vpage -1.
to make it easy, all pictures whose names are stored in the flexgrid will be
loaded into the image control named IMG_TB. Since the number of imagens is
not allways the same, my plan is to create an array of the image control.
My problem:
I get stucked in this line
IMG_TB(vpct, vpag).Picture = LoadPicture(NPOS_01.FIL_FOTOS.Path & "\" &
NPOS_01.GRD_FOTOS.Text)
VB allways says that an object is required
It's VB6
Can anyone help me?
Thanks.
Please Post Reply Here.
NC
Set IMG_TB(vpct, vpag).Picture = <picture object>
"NC" <oceano...@netmadeira.com> wrote in message
news:4b3668f7$0$6163$a729...@news.telepac.pt...
What do you mean by Set IMG_TB(vpct,vpag).picture = <picture object>?
In this case what is <picture object>?
NC
"C. Kevin Provance" <*@*.*> wrote in message
news:u$DO51mhK...@TK2MSFTNGP04.phx.gbl...
"NC" <oceano...@netmadeira.com> wrote in message
news:4b367b7b$0$6163$a729...@news.telepac.pt...
> Hi there,
>
> What do you mean by Set IMG_TB(vpct,vpag).picture = <picture object>?
> In this case what is <picture object>?
> NC
Your LoadPicture statement. Kevin just phrased it as <picture object>
because that's what you need to assign to the Picture property. LoadPicture
is a function that returns a Picture object.
--
Mike
You have declared IMG_TB to be a 2D array of Variants, but you try to use
it as an array of Image controls. In short, a Variant does not have a Picture
property....
LFS
Actually it's unclear what the data type is. If the data type was omitted,
ReDim uses the same data type used when the variable was declared, and an
error occurs if it's a different data type. If it was not declared before,
then Variant is assumed, and no error is generated even if Option Explicit
is used. However, it seems likely that the OP is using it as declarative
statement and it's probably Variant.
> However, it seems likely that the OP is using it as declarative
> statement and it's probably Variant.
OK:
> > You have probably declared IMG_TB to be a 2D array ...
:-P
LFS