c# - Not able to count line number in richtextbox -
here code
private void allocation_matrix_keypress(object sender, keypresseventargs e) { if (e.keychar == 13) { int total_row_check; total_row_check = getrow(); textbox1.text = convert.tostring(total_row_check); if (total_row_check >= convert.toint32(total_processes.text)) { messagebox.show("rows cannot exceed total number of processess"); } } } public int getrow() { int row = 0; string[] arlines; int i; arlines = allocation_matrix.text.split(new string[] { environment.newline }, stringsplitoptions.none); (i = 0; < arlines.length; i++) { row++; } return row; } i want update textbox1 hit enter in richtextbox keyboard...but textbox keeps show firstrow , shows one(1)
how using richtextbox.getlinefromcharindex method? returns, zero-based line number in character index located.
Comments
Post a Comment