当前位置:网站首页>C# richTextBox控制最大行数
C# richTextBox控制最大行数
2022-06-23 07:29:00 【pcjiushizhu】
private void m_txtComment_TextChanged(object sender, EventArgs e)
{
int lines = m_txtComment.GetLineFromCharIndex(m_txtComment.Text.Length - 1); //m_txtComment.Lines.Length; //行数
if(lines > maxLine - 1)
{
//第6行第一个字的位置
int my_index = m_txtComment.GetFirstCharIndexFromLine(maxLine);
//只保留前五行
m_txtComment.Text = m_txtComment.Text.Substring(0, my_index - 1);
}
m_ri.CommentContent.Content = m_txtComment.Text;
m_txtComment.Select(m_txtComment.Text.Length, 0);
}
边栏推荐
猜你喜欢

论文写作之WPS安装Mathtype插件编写数学公式

1278_ FreeRTOS_ Understand the delayed task with the prvaddcurrenttasktodelayedlist interface

vs在连接SQL时出现的问题myconn.OPen();无法运行

【Try to Hack】ip地址

YGG Spain subdao Ola GG officially established

The Sandbox 与《足球小将》达成合作,将流行的足球漫画及动画带入元宇宙

深度学习------不同方法实现vgg16

测试apk-异常管控NetTraffic攻击者开发

Test APK exception control nettraffic attacker development
![[pyqt5 series] modify the counter to realize control](/img/de/c997a19ad72619b0fd2fcd0124ee1a.png)
[pyqt5 series] modify the counter to realize control
随机推荐
在kubernetes中部署kubersphere
这道字符串反转的题目,你能想到更好的方法吗?
Query on the performance of multi table view in MySQL
ArcMap批量删除距离较近的点
HCIP之路第八次实验
分布式ID生成
【唠嗑篇】普通人到底该怎么学技术啊?
快手350014
Eureka服务注册与发现
vtk.js鼠标左键滑动改变窗位和窗宽
Unity picture loading and saving
2.概率论-概率论公理
How MySQL converts a date to a number
Qt工程报错:-1: error: Cannot run compiler ‘clang++‘. Output:mingw32-make.exe
What is customer experience automation?
socket编程(多进程)
[Planet selection] how to efficiently build fine-grained two-way links between roam and thebrain?
浅谈ThreadLocal和InheritableThreadLocal,源码解析
How bootstrap clears floating styles
Ffplay realizes user-defined input stream playback