Creo que solo te falta contar los intentos y hacer entero el valor de n.
Código vb:
Ver originalPublic Class Form1
Dim n As Integer
Dim Intentos As Integer
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Randomize()
n = Int(Rnd() * 100 ) + 1
TextBox1.Text = n
Intentos = 0
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
If Val(TextBox2.Text) > n Then
MsgBox "El numero es MEnor"
Intentos = Intentos + 1
ElseIf Val(TextBox2.Text) < n Then
MsgBox " el numero es MAyor "
Intentos = Intentos + 1
Else
MsgBox " Has acertado el numero "
End
End If
If Intentos > 9 Then
MsgBox "Demasiados intentos. Has fallado."
End
End If
End Sub
End Class