vb.net - To remove last line of a richtextbox -
i need remove last line of richtextbox. tried several ways. nothing worked. please me
for t = len(texto) 0 step -1 if mid(texto, t, 1) = vbcr c = c + 1 'texto = mid(texto, 1, t - 1) don't end if ' if c = 2 exit next richtextbox2.text = left$(texto, t - 1)
dim lastline integer = ubound(richtextbox2.lines) if lastline > -1 dim newlines() string integer = 0 lastline if < lastline redim preserve newlines(i) newlines(i) = richtextbox2.lines(i) end if next richtextbox2.lines = newlines end if
Comments
Post a Comment