‘接上楼:
'timecontrol
Private Sub timertime_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles timertime.Tick
time = time + 1
lblgametime.Text = time.ToString
End Sub
'colors and fonts
Private Sub updatecolors(ByRef lbl As Label)
If lbl.Text = "" Then
lbl.BackColor = Color.FromArgb(238, 223, 204) 'empty color
End If
If lbl.Text = "2" Then
lbl.BackColor = Color.FromArgb(255, 255, 255) 'white
lbl.ForeColor = Color.Black
''problem here
End If
If lbl.Text = "4" Then
lbl.BackColor = Color.FromArgb(255, 250, 205) 'light yellow
lbl.ForeColor = Color.Black
End If
If lbl.Text = "8" Then
lbl.BackColor = Color.FromArgb(255, 222, 173) 'light orange
lbl.ForeColor = Color.White
End If
If lbl.Text = "16" Then
lbl.BackColor = Color.FromArgb(255, 211, 145) 'light orange
lbl.ForeColor = Color.White
End If
If lbl.Text = "32" Then
lbl.BackColor = Color.FromArgb(255, 160, 115) 'light red
lbl.ForeColor = Color.White
End If
If lbl.Text = "64" Then
lbl.BackColor = Color.FromArgb(255, 64, 64) 'red
lbl.ForeColor = Color.White
End If
If lbl.Text = "128" Then
lbl.BackColor = Color.FromArgb(255, 246, 143) 'light yellow
lbl.Font = New Font("calibri", 28, FontStyle.Bold)
lbl.ForeColor = Color.White
End If
If lbl.Text = "256" Then
lbl.BackColor = Color.FromArgb(255, 235, 120) 'light yellow
lbl.Font = New Font("calibri", 28, FontStyle.Bold)
lbl.ForeColor = Color.White
End If
If lbl.Text = "512" Then
lbl.BackColor = Color.FromArgb(255, 225, 115) 'light yellow
lbl.Font = New Font("calibri", 28, FontStyle.Bold)
lbl.ForeColor = Color.White
End If
If lbl.Text = "1024" Then
lbl.BackColor = Color.FromArgb(255, 230, 100) 'yellow
lbl.Font = New Font("calibri", 24, FontStyle.Bold)
lbl.ForeColor = Color.White
End If
If lbl.Text = "1024" Then
lbl.BackColor = Color.FromArgb(255, 230, 100) 'yellow
lbl.Font = New Font("calibri", 24, FontStyle.Bold)
lbl.ForeColor = Color.White
End If
If lbl.Text = "2048" Then
lbl.BackColor = Color.FromArgb(255, 230, 30) ' dark yellow
lbl.Font = New Font("calibri", 24, FontStyle.Bold)
lbl.ForeColor = Color.White
End If
If lbl.Text = "4096" Then
lbl.BackColor = Color.FromArgb(238, 174, 238) ' light purple
lbl.Font = New Font("calibri", 24, FontStyle.Bold)
lbl.ForeColor = Color.White
End If
If lbl.Text = "8192" Then
lbl.BackColor = Color.FromArgb(238, 145, 238) ' light purple
lbl.Font = New Font("calibri", 24, FontStyle.Bold)
lbl.ForeColor = Color.White
End If
If lbl.Text = "4096" Then
lbl.BackColor = Color.FromArgb(238, 174, 238) ' dark yellow
lbl.Font = New Font("calibri", 24, FontStyle.Bold)
lbl.ForeColor = Color.White
End If
If lbl.Text = "8192" Then
lbl.BackColor = Color.FromArgb(180, 100, 238) ' dark yellow
lbl.Font = New Font("calibri", 24, FontStyle.Bold)
lbl.ForeColor = Color.White
End If
If lbl.Text = "16384" Then
lbl.BackColor = Color.FromArgb(150, 100, 238) ' dark yellow
lbl.Font = New Font("calibri", 20, FontStyle.Bold)
lbl.ForeColor = Color.White
End If
If lbl.Text = "32768" Then
lbl.BackColor = Color.FromArgb(40, 40, 238) ' dark yellow
lbl.Font = New Font("calibri", 20, FontStyle.Bold)
lbl.ForeColor = Color.White
End If
If lbl.Text = "65536" Then
lbl.BackColor = Color.FromArgb(0, 0, 0) ' dark yellow
lbl.Font = New Font("calibri", 20, FontStyle.Bold)
lbl.ForeColor = Color.White
End If
End Sub
End Class
2014年05月26日 13点05分
15