LIMITAR QTDE, DE LINHAS EM UM RICHTEXTBOX

PERCIFILHO 04/05/2012 14:15:30
#401375
Boa tarde, pessoal.
O usuário irá preencher um RichTextBox e quando alcançar o total de 25 linhas, ele não poderá mais digitar nada.
Consigo pegar o total de linhas e verificar, no evento TextChanged do RichTextBox:

rivate Sub Rtb_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Rtb.TextChanged
If Rtb.Lines.Length >= 25 Then
MsgBox([Ô]Quantidade máxima de linhas por recibo.[Ô], MsgBoxStyle.Critical)
Exit Sub
End If
End Sub

Porém, após enviar a mensagem, ao teclar Enter, ele cria uma nova linha.
Precisaria fazer com que ao teclar Enter, se for a quantidade de linhas máxima, ele emite a mensagem e sai sem adicionar uma linha no RichTextBox.

Enquanto aguardo respostas, vou tentando...

Até mais.
PERCIFILHO 07/05/2012 07:07:26
#401463
Por falta de respostas, encerro o tópico
Tópico encerrado , respostas não são mais permitidas