Ok - found the answer. The problem is that the panel control will not allow you to set the .left value of any child objects to anything greater than 32767 (short). I have no idea why this is. If you set it to anything larger it will just ignore you and reset it to 32767. So as I built my timeline all of my thumbnail windows that needed to go beyond a .left of 32767 were getting plopped on top of each other.
The answer was to NOT use the panel control, but to create my own container made of system.windows.forms.form. It required a little setup, but that was relatively easy and straight-forward. Here is a test harness I created to make it work:
-
Imports WXC
-
Public Class Form1
-
Private WinHost As New System.Windows.Forms.Form
-
Private tWin() As WXC.ThumbnailWindow
-
-
-
Private Sub MakeTimeline()
-
-
'size and position the host window
-
-
With WinHost
-
.TopLevel = False
-
.Visible = False
-
.Parent = Me
-
.Left = pnltl.Left + 2
-
.Top = pnltl.Top + 2
-
.Height = pnltl.Height - 4
-
.Width = pnltl.Width - 4
-
.BackColor = Color.DimGray
-
.FormBorderStyle = Windows.Forms.FormBorderStyle.None
-
.Cursor = Cursors.Hand
-
.AutoScroll = True
-
End With
-
-
ReDim tWin(800)
-
-
WinHost.SuspendLayout()
-
For I = 0 To UBound(tWin)
-
tWin(I) = New ThumbnailWindow(My.Resources.Axis_320x180_6034e_thumb, String.Empty)
-
tWin(I).Parent = WinHost
-
tWin(I).Picture = My.Resources.Axis_320x180_6034e_thumb
-
tWin(I).Location = New System.Drawing.Point((I * 128) + 3, 2)
-
tWin(I).DayAndTime = I.ToString & " " & tWin(I).Left.ToString
-
WinHost.Controls.Add(tWin(I))
-
Next
-
WinHost.ResumeLayout()
-
WinHost.Refresh()
-
WinHost.BringToFront()
-
WinHost.Visible = True
-
MsgBox("Done")
-
-
End Sub
-
-
Private Sub btnMakePanels_Click(sender As System.Object, e As System.EventArgs) Handles btnMakePanels.Click
-
MakeTimeline()
-
End Sub
-
-
Private Sub btnBegin_Click(sender As System.Object, e As System.EventArgs) Handles btnBegin.Click
-
With WinHost
-
.ScrollControlIntoView(tWin(0))
-
End With
-
End Sub
-
-
Private Sub btnEnd_Click(sender As System.Object, e As System.EventArgs) Handles btnEnd.Click
-
WinHost.ScrollControlIntoView(tWin(UBound(tWin)))
-
End Sub
-
End Class
-
The wxc.thumbnailwindow object is a simple custom control that I made. Sorry I can't share it here because it is the IP of my employer - suffice to say it is just a very simple control made up of a panel, a picturebox and a label. I created this for simplicity. You could make the same thing without creating a custom control.
The only problem I run into now is that there is a limit to the number of Handles Windows will allow (~2000) - but I'm not worried about that limit for my application.
I should also explain that pnltl is a panel control that I put on the form as a placeholder for the new control (the one made from system.forms.form). I did this so there isn't a big empty space to stare at before the timeline is made. It also provides the dimensions and a pretty border for my final control.
The result is great and looks exactly the way I want. There are also plenty of scroll events and methods to give me programatic control.
float mouse over image to see the whole thing
The thumbnails above each show the thumbnail number and the .left property - so you can see it goes well above the 32767 allowed by the wimpy panel control.
Yay.