Sub LoadSlideShow()
b4iMash.ShowProgress("Loading slideshow...")
b4iMash.OpenDb
' clear all views in the panel
svSlideShow.Panel.RemoveAllViews
Dim cur As ResultSet
Dim sPath As String
cur = b4iMash.Table_OpenRecordset(b4iMash.SQLite,"select * from [Pictures] order by [Key]")
Do While cur.NextRow
Dim sKey As String: sKey = cur.GetString("Key")
Dim sText As String: sText = cur.GetString("Text")
Dim sTag As String: sTag = cur.GetString("Tag")
sPath = sTag.replace("[","")
sPath = sPath.replace("]","")
sPath = sPath.replace(",","")
sPath = sPath.replace("-","")
sPath = sPath.ToLowerCase & ".jpg"
' load a new panel and inset image
Dim pnlImage As Panel
pnlImage.Initialize("")
pnlImage.LoadLayout("slideImage")
' get the parent panel
pnlMaster = pnlImage.GetView(0)
' get the label inside the panel
lblTitle = pnlMaster.GetView(0)
lblTitle.Text = sText
imgPicture = pnlMaster.GetView(1)
imgPicture.Bitmap = LoadBitmap(File.DirAssets, sPath)
svSlideShow.Panel.AddView(pnlImage,0,0,svSlideShow.Width,svSlideShow.Height)
svSlideShow.ContentWidth = pnlImage.Width
svSlideShow.ContentHeight = pnlImage.Height
Loop
cur.close
b4iMash.HideProgress
End Sub