Erel, thanks for the gravity.fill tip - works spot on.
Any idea why the gravity.fill is required in some instances and not others?
my two subs are very similar - as shown below
I would be interested for my understanding
thanks
1st sub
<------------------------------------------------
Sub thumbclick_click
Dim tc As ImageView
Dim ths1 As ths
Dim sv1 As ScrollView
Dim pn1 As Panel
ImageView3.visible = False
ImageView3.enabled = False
ImageView4.visible = False
ImageView4.enabled = False
clearpanel2
tc = Sender
ths1=tc.Tag
clickedthumb = ths1.folderb
clickedthumb2 = ths1.indexb
If thumbflag = 0 Then
addthumbs(databholder,dataaholder)
thumbflag = 1
Return
End If
If thumbflag = 1 Then
If tc.IsInitialized = True Then tc.RemoveView
sv1.Initialize(1115)
pn1 = sv1.Panel
sv1.BringToFront
pn1.BringToFront
Panel2.AddView(sv1,0,0,750,470)
tc.bitmap= LoadBitmapSample(File.DirRootExternal & "/docbrowser", clickedthumb, 750, 1110)
pn1.AddView(tc,5,5,740,1100)
thumbflag = 0
If thumbcount <>0 Then
checkimagecount(databholder,dataaholder)
End If
End If
End Sub
>---------------------------------------------------------
2nd sub
<-----------------------------------------------------------
Sub updateimage(clickedthumb2a)
Dim tc As ImageView
Dim ths1 As ths
Dim sv1 As ScrollView
Dim pn1 As Panel
Dim cursor1 As Cursor
clearpanel2
If minthumb < clickedthumb2 Then
ImageView4.Visible = True
ImageView4.enabled = True
Else
ImageView4.visible = False
ImageView4.enabled = False
End If
If maxthumb > clickedthumb2 Then
ImageView3.visible = True
ImageView3.enabled = True
Else
ImageView3.visible = False
ImageView3.enabled = False
End If
cursor1 = sql1.ExecQuery2("select Manual, Section, Page, ID from Items where ID= ?", Array As String(clickedthumb2a))
cursor1.Position=0
manuala = cursor1.GetString("Manual")
manuala = manuala.Replace(" ","_")
sectiona = cursor1.GetString("Section")
sectiona = sectiona.Replace(" ","_")
page = cursor1.GetString("Page")
page=page.Replace(" ","_")
folderb = manuala & "/" & sectiona & "/" & page & ".jpeg"
ths1.folderb = folderb
ths1.indexb = clickedthumb2a
cursor1.Close
If tc.IsInitialized = True Then tc.RemoveView
sv1.Initialize(1115)
pn1 = sv1.Panel
sv1.BringToFront
pn1.BringToFront
Panel2.AddView(sv1,0,0,750,470)
tc.Initialize("thumbclick")
tc.bitmap= LoadBitmapSample(File.DirRootExternal & "/docbrowser", folderb, 750, 1110)
tc.Gravity=Gravity.FILL
pn1.AddView(tc,5,5,740,1100)
tc.Tag = ths1
End Sub
>--------------------------------------------------------