I am trying to get a panel to display 5 item from a arraylist using the graphics tool but i can only get it to display every item in the arraylist.
So if is 10 items in the arraylist the panel will show the first 5 items and if i click on the next button the panel will show items 2 - 6.
here is the code for the panel:
here is the code for the navigation button:
any help will be appricated
Tony
So if is 10 items in the arraylist the panel will show the first 5 items and if i click on the next button the panel will show items 2 - 6.
here is the code for the panel:
Code:
Private Sub pnlDisplay_Paint(ByVal sender As System.Object, ByVal e As System.Windows.Forms.PaintEventArgs) Handles pnlDisplay.Paint
Dim strOutput As String
Dim x, y As Integer
x = 5
y = 5
Dim fntOut As New Font("Time New Roman", 10.0F)
Dim currBrush As New SolidBrush(Color.Black)
Dim i As Integer
While i < nCurrentTask
g.FillEllipse(colour, x, y, 15, 15)
currTask = arrList(i)
strOutput = currTask.GetDescription + " " + currTask.GetTaskDate
g.DrawString(strOutput, fntOut, currBrush, x + 20, y)
y += Convert.ToInt32(fntOut.Height)
i += 1
GrabInfo()
End While
End Sub
here is the code for the navigation button:
Code:
rivate Sub NextTask()
If nCurrentTask < arrList.Count Then
nCurrentTask += 1
Else
nCurrentTask = arrList.Count
End If
pnlDisplay.Invalidate()
labelDisplay()
End Sub
any help will be appricated
Tony
Last edited: