I am sort of wondering what kind of use this code has, other then a system wide keylogger, anyway to answer your question, this would do the trick but its not foolproof(like it can't detect selected text and remove that)
If key <> Nothing Then
If My.Computer.Keyboard.ShiftKeyDown OrElse My.Computer.Keyboard.CapsLock Then
txtlogs.Text &= key.ToUpper
ElseIf key = vbBack Then
If txtlogs.TextLength > 0 Then
txtlogs.Text = txtlogs.Text.Remove(txtlogs.TextLength - 1)
End If
Else
txtlogs.Text &= key.ToLower
End If
End If