void ScrollingTick(Object timeObject, EventArgs eventArgs)
{
// Get mouse coordinates
Point point = Control.MousePosition;
point = PointToClient(point);
if ( upTimerTicking )
{
if ( buttonPushed )
{
if ( upArrowRect.Contains(point))
{
upArrowPressed = true;
if ( firstItem > 0 )
{
firstItem--;
Rectangle rc = GetViewPortRect();
Invalidate(rc);
}
else
doScrollingLoop = false;
}
else
upArrowPressed = false;
}
}
else if ( downTimerTicking )
{
if ( buttonPushed )
{
if ( downArrowRect.Contains(point))
{
downArrowPressed = true;
using ( Graphics g = Graphics.FromHwnd(Handle) )
{
// Get the last item rectangle
OutlookBarBand band = bands[currentBandIndex];
Rectangle rcItem = GetItemRect(g, band, band.Items.Count - 1, Rectangle.Empty);
Rectangle rc = GetViewPortRect();
if ( rcItem.Bottom > rc.Bottom )
{
firstItem++;
Invalidate(rc);
}
}
}
else
doScrollingLoop = false;
}
else
downArrowPressed = false;
}
}