private void timer_Tick(object sender, EventArgs e) { if (tickCounter == 30) { ((Timer)sender).Dispose(); } tickCounter++; for (int i = 0; i < 4; i++) { current[i] += increment[i]; } DrawingControl.SuspendDrawing(panel1); bar0.Location = new Point(bar0.Location.X, defaultY + (int)(maxBarHeight - current[0])); bar0.Height = (int)current[0]; bar1.Location = new Point(bar1.Location.X, defaultY + (int)(maxBarHeight - current[1])); bar1.Height = (int)current[1]; bar2.Location = new Point(bar2.Location.X, defaultY + (int)(maxBarHeight - current[2])); bar2.Height = (int)current[2]; bar3.Location = new Point(bar3.Location.X, defaultY + (int)(maxBarHeight - current[3])); bar3.Height = (int)current[3]; DrawingControl.ResumeDrawing(panel1); Invalidate(); }
private void answerHoverOff(Panel p, Label letter, Label text, bool left) { if (blockHover) { return; } DrawingControl.SuspendDrawing(p); if (left) { p.BackgroundImage = Properties.Resources.leftAnswer; } else { p.BackgroundImage = Properties.Resources.rightAnswer; } text.BackColor = Color.FromArgb(35, 31, 32); letter.BackColor = Color.FromArgb(35, 31, 32); DrawingControl.ResumeDrawing(p); Cursor = Cursors.Default; }