Shane;
I tried but finally got lost!
Below is a simplified version of the routine I used to display multiple
windows on a desktop. The last part is where I tried to send the new window
to a different "Bound" but it never worked!
Any suggestion is greatly appreciated.
Bill
Private Sub loadMaps(ByVal dV As DataView, ByVal mMonitor As Integer)
Dim mdVR As DataRowView
dV.RowFilter = "monitorID = " & mMonitor
If dV.Count <= 0 Then
' MsgBox("No records found")
Exit Sub
End If
Dim mUrl, mMPPath As String ' mScreen, mUrl2, mUrl3, mUrl4 As String
Dim mScreenName, mvehicleID, mButtonName, mButtonText As String
Dim mModulus As Integer
Dim mPanel As New TableLayoutPanel
Dim mWeb, mWeb1, mWeb2, mWeb3, mWeb4 As New WebBrowser
Dim mButton, mButton1, mButton2, mButton3, mButton4 As Button
With mPanel
.ColumnCount = 2
.ColumnStyles.Add(New
System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent,
50.0!))
.ColumnStyles.Add(New
System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent,
50.0!))
.RowCount = 2
.RowStyles.Add(New
System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 50.0!))
.RowStyles.Add(New
System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 50.0!))
For Each mdVR In dV
mScreenName = mdVR.Item("panelID").ToString.Trim
mvehicleID = mdVR.Item("vehicleID").ToString.Trim
mUrl = "
http://masterserver/" & mdVR.Item("mapPath1").Trim
mMPPath = mdVR.Item("mapPath2").ToString
mModulus = mdVR.Item("panelID") - ((mMonitor - 1) * 4)
mButtonName = mdVR.Item("mapPath2").ToString.Trim
mButtonText = "View GPS trail for vehicle " & mvehicleID & "
in Mappoint"
Select Case mModulus
Case 1
With mWeb1
.Dock = DockStyle.Fill
.Navigate(mUrl)
End With
.Controls.Add(mWeb1, 0, 0)
Case 2
With mWeb2
.Dock = DockStyle.Fill
.Navigate(mUrl)
End With
.Controls.Add(mWeb2, 1, 0)
Case 3
With mWeb3
.Dock = DockStyle.Fill
.Navigate(mUrl)
End With
.Controls.Add(mWeb3, 0, 1)
Case 4
With mWeb4
.Dock = DockStyle.Fill
.Navigate(mUrl)
End With
.Controls.Add(mWeb4, 1, 1)
Case Else
End Select
.Dock = DockStyle.Fill
Next
End With
Dim thisX, thisY, thisW, thisH As Integer
thisY = 0
thisW = 1152
thisH = 864
thisX = 1152 * (mMonitor - 1)
' MsgBox(thisX & " - " & thisY)
' Dim frmScreen As New frmMultiScreens
Dim frmScreen As New frmBlank
With frmScreen
.Text = "WF Truck Breadcumbs Display"
' .SetBounds(thisX, thisY, thisW, thisH)
'.SetDesktopBounds(thisX, thisY, thisW, thisH)
.Controls.Add(mPanel)
.WindowState = FormWindowState.Maximized
' .SetDisplayRectLocation(thisX, thisY)
.Show()
'.ShowDialog()
End With
'Me.Controls.Add(mPanel)
'Me.WindowState = FormWindowState.Maximized
End Sub