I have a form that is laid out as in the attached file.
The information in the sub panels is retrieved through web services and is unfortunately quite slow - taking around a minute per 100 results to update fully.
Assume the large panel is called MainPanel and the smaller sub panels are called SubPanel(resultNumber).
The main panel can be scrolled up and down by the user whilst the detail in the sub panels are populating. A user can typically fit around 15 sub panels on the screen at a time.
How can I detect what sub panels are visible to the user after they scroll?
I wish to do this so that I can populate the panels on the screen (ie visible to the user) as a priority.
Sub createPanels(byVal results as Array)
Dim NumberOfResults as integer = results.length
Dim SubPanel(NumberOfResults) as Panel
For resultNumber = 0 to NumberOfResults - 1
SubPanel(resultNumber) = new Panel
.BorderStyle = BorderStyle.Fixed3d
.Dock = DockStyle.Top
.Height = 60
' Code to add labels etc from results array to the SubPanel
' At the moment the call to webservices is in here as well,
' although this is asynchronous and triggers an event when the call is
' complete allowing me to use this data on my SubPanels when it becomes
' available. I will move these calls to a new sub allowing only 15 requests
' at a time but I need to know which panels are onscreen in order to
' prioritise which ones are to be updated next.
' There are several controls that can be clicked on each SubPanel so we add
' a handler
AddHandler SubPanelItem(resultNumber).Click, AddressOf PanelItemClicked