From: NC on 26 Dec 2009 14:50 Hi there, 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
From: C. Kevin Provance on 26 Dec 2009 15:53 Pictures need to be Set Set IMG_TB(vpct, vpag).Picture = <picture object> "NC" <oceano.web.pt(a)netmadeira.com> wrote in message news:4b3668f7$0$6163$a729d347(a)news.telepac.pt... | Hi there, | | 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 | |
From: NC on 26 Dec 2009 16:09 Hi there, 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$DO51mhKHA.5604(a)TK2MSFTNGP04.phx.gbl... > Pictures need to be Set > > Set IMG_TB(vpct, vpag).Picture = <picture object> > > > "NC" <oceano.web.pt(a)netmadeira.com> wrote in message > news:4b3668f7$0$6163$a729d347(a)news.telepac.pt... > | Hi there, > | > | 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 > | > | > >
From: MikeD on 26 Dec 2009 18:38 "NC" <oceano.web.pt(a)netmadeira.com> wrote in message news:4b367b7b$0$6163$a729d347(a)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
From: Larry Serflaten on 27 Dec 2009 01:39
"NC" <oceano.web.pt(a)netmadeira.com> wrote > I have this portion of code: > > ReDim IMG_TB(0 To vtotfot - 1, vPaginas) <...> > 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 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 |