Yes: the
sender
parameter contains the source control that raised the event.
So all you need to do is set all the Textboxes to use the same handler and use the parameter to control which box:
Private Sub AllTextBoxes_Click(sender As Object, e As EventArgs) Handles txtM11.Click
...
Count = Count - 1
Dim tb As TextBox = TryCast(sender, TextBox)
If tb IsNot Nothing Then
If Count = 4 Then
tb.BackColor = Color.Red
ElseIf Count = 3 Then
tb.BackColor = Color.Green
ElseIf Count = 2 Then
tb.BackColor = Color.MediumPurple
ElseIf Count = 1 Then
tb.BackColor = Color.Blue
ElseIf Count = 0 Then
tb.BackColor = Color.White
Count = 5
End If
End If