Time for action – fixing the scrolling delay
Reopen the Design mode view of the
MapEditor
window.Double-click on the timer control in the Toolbox window to add a new instance to the
MapEditor
form. As with theImageList
control, the timer is not visible and will appear in the editor as an icon and label below the design window. Give the timer control the following properties:Name:
timerGameUpdate
Enabled:
True
Interval:
20
Double-click on the
timerGameUpdate
control to generate aTick
event handler, and add the following code to it:Private Sub timerGameUpdate_Tick(sender As System.Object,e As System.EventArgs) Handles timerGameUpdate.Tick If hScrollBar1.Maximum < 0 Then FixScrollBarScales() End If game.Tick() If game.HoverCodeValue <> lblCurrentCode.Text Then lblCurrentCode.Text = game.HoverCodeValue End If End Sub
Execute the application. Draw a few tiles on the map, and use the scroll bars to verify that they function as expected.
What just happened?
Using the scroll...