在c#中计算文本框中的字符数 [英] Count Characters in Textbox in c#

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

问题描述

大家好。

我想在多行文字框的底部使用statuse栏。

但是我不知道我怎么能算出行和行的字符光标在上面。当我移动光标时,应该改变直线和直线的字符。看起来像是视觉工作室里的statuse吧。

请帮帮我。

谢谢。



编辑:删除粗体

Hi guys.
I want to use statuse bar in bottom of multiline text box.
But i dont know How can i count the line and line's characters that the cursor is overthere. and when i move the cursor the line and line's character should be changed. look like statuse bar in visual studio.
Please help me.
Thank you.

Removed Bold

推荐答案

int lines = RichTextBox1.Lines.Length;         // count lines
int chars = RichTextBox1.Text.Length;       //count characters


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

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