如何计算richtextbox c中的项目数# [英] how to count number of items inside richtextbox c#

查看:71
本文介绍了如何计算richtextbox c中的项目数#的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何计算rictextbox内的项目

并将其显示在标签上。





例如listbox





how do I count the items inside rictextbox
and display it on a label.


for example like listbox


label1.text = listbox1.items.count();





我该怎么做with richtextbox



how do i do this with richtextbox

推荐答案

试试这个:
YourLabel.Text = YourRichTextBox.Lines.Length.ToString();

请记住,如果启用自动换行,可能会影响最终用户感知 RichtTextBox中行数的方式。

Keep in mind that if word-wrap is enabled, that may effect the way the end-user perceives the number of lines in a RichtTextBox.


这篇关于如何计算richtextbox c中的项目数#的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆