where is the difference ?

madru

Active Member
Licensed User
Longtime User
Hi,

can somebody please explain why this does work:

Code: Copy
NbCols=3
   For r = 0 To 0  '<----------?????????
      For c = 0 To NbCols -1
         j = r * NbCols + c
         Dim pnl As Panel
         titles.Add("Title" & j)
         pnl.Initialize("pnl")
         j=r*RowHeight
         scvTest.Panel.AddView(pnl, c * ColWidth, r * RowHeight, ColWidth, RowHeight)
         pnl.Tag = j
         pnl.Color = Colors.Transparent
         Dim bmp As Bitmap
         bmp.Initialize(File.DirAssets, RemotePicture(j))
         Dim cvs As Canvas
         cvs.Initialize(pnl)
         cvs.DrawBitmap(bmp, Null, ImageRect)
      Next
   Next

and this not?

Code: Copy
r=0
NbCols=3
      For c = 0 To NbCols -1
         j = r * NbCols + c
         Dim pnl As Panel
         titles.Add("Title" & j)
         pnl.Initialize("pnl")
         j=r*RowHeight
         scvTest.Panel.AddView(pnl, c * ColWidth, r * RowHeight, ColWidth, RowHeight)
         pnl.Tag = j
         pnl.Color = Colors.Transparent
         Dim bmp As Bitmap
         bmp.Initialize(File.DirAssets, RemotePicture(j))
         Dim cvs As Canvas
         cvs.Initialize(pnl)
         cvs.DrawBitmap(bmp, Null, ImageRect)
      Next


THX
 
1st version shows Panel and Bitmaps, 2nd not

a 0 to 0 loop should be the same as 0 ;)
 
Upvote 0
For me there is no reason that the second code doesn't work.
You should post the whole code, I suspect that the problem is somewhere else.

I don't understand this code:
Code: Copy
j = r * RowHeight
.
pnl.Tag = j
j is 0 for all views in the row and if r > 0 the Tag is proportional to the RowHeight ?

Best regards.
 
Upvote 0
Back
Top