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 the ImageList 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 a
Tick
event handler and add the following code to it:private void timerGameUpdate_Tick(object sender, EventArgs e) { if (hScrollBar1.Maximum < 0) { FixScrollBarScales(); } game.Tick(); if (game.HoverCodeValue != lblCurrentCode.Text) lblCurrentCode.Text = game.HoverCodeValue; }
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 bars does not prevent the Timer control from...