HOW TO: create a slide show of websites

Skip Navigation LinksIrocon > Blog > 2003 > November, 2003 > November 15, 2003 > HOW TO: create a slide show of websites

HOW TO: create a slide show of websites

I am designing an application that shows several websites in the form of a slide show. I have come up with a starting point for my app

1. I use a web browser control
2. I load URLs into a collection from an xml file
3. I use two timers, one to load the next url and the other to do the animation

here is where I am at so far:
===========================================
Public Class frmSlide
Inherits System.Windows.Forms.Form
Dim nullObject As System.Object = 0
Dim strNull As String = ""
Dim nullObjStr As System.Object = strNull
Dim URLList As New Microsoft.VisualBasic.Collection()
Dim iCount, iPos As Integer
Dim bAnimate As Boolean = False
Dim bAnimating As Boolean = False

#Region " Windows Form Designer generated code "
#End Region


Private Sub frmSlide_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Load
URLList.Add("http://www.hiazle.bravehost.com/")
URLList.Add("http://www.gotdotnet.com/")
URLList.Add("http://www.planet-source-code.com/vb/")
URLList.Add("http://www.vb2themax.com/default.asp?PageID=Welcome/")
URLList.Add("http://www.devcity.net/net/")
URLList.Add("http://msdn.microsoft.com/vbasic/downloads/samples/default.aspx")
URLList.Add("http://www.dotnetextreme.com/vb.asp")
URLList.Add("http://www.dnzone.com/")
URLList.Add("http://www.codearchive.com/dir.php?go=1000")
URLList.Add("http://msdn.microsoft.com/")

iCount = 10
iPos = 1
End Sub

Private Sub tmrBrowse_Elapsed(ByVal sender As System.Object, ByVal e As System.Timers.ElapsedEventArgs) Handles tmrBrowse.Elapsed
If iPos < 1 Or iPos > iCount Then
iPos = 1
End If
Cursor.Current = Cursors.WaitCursor
AxWebBrowser1.Navigate(URLList(iPos), nullObject, nullObjStr, nullObjStr, nullObjStr)
Cursor.Current = Cursors.Default
iPos += 1
tmrAnimate.Enabled = True
End Sub

Private Sub tmrAnimate_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles tmrAnimate.Tick
If bAnimate Then
'perform animation of web browser
If bAnimating Then
'perform the next stage of animation
Else
'start animation routine
bAnimating = True
End If
Else
'do nothing
'OR disable timer
tmrAnimate.Enabled = False
End If

End Sub
End Class

=========================================
I was planning on animating the browser by moving it around (e.g. from bottom-right to top-left) using:

AxWebBrowser1.Top -= 10
AxWebBrowser1.Left -= 10

Is there a simpler way to do the animation process?

Last Updated:Thursday, September 02, 2010By:alfero#

Would you like to comment?

Sign in with your OpenID. If you do not know what OpenID is, find out.