当前位置:网站首页>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);
}
边栏推荐
猜你喜欢
![Acwing game 56 [End]](/img/f6/cd650331c819a27f17c9ce6cd0c569.png)
Acwing game 56 [End]

转盘式视觉筛选机及其图像识别系统

【Veusz】导入CSV中的二维数据

Eureka service registration and discovery

聊聊服务治理中的路由设计

The sandbox has reached a cooperation with football player to bring popular football cartoons and animation into the metauniverse

Talk about routing design in service governance
![[cloud computing event] vocational skill competition -- container development example pig rapid development framework](/img/4b/393b5980090330602a501867c60089.png)
[cloud computing event] vocational skill competition -- container development example pig rapid development framework

openni.utils.OpenNIError: (OniStatus.ONI_STATUS_ERROR, b‘DeviceOpen using default: no devices found‘

Qt工程报错:-1: error: Cannot run compiler ‘clang++‘. Output:mingw32-make.exe
随机推荐
Decoding and practice of cmaf Technology
11 字符串函数
[interface automation] software testing the core skills of salary increase to increase salary by 200%
Tri rapide + Tri par bulle + Tri par insertion + Tri par sélection
【云计算赛项】职业技能竞赛--容器开发部分例题Pig快速开发框架
【Try to Hack】ip地址
Deploy kubersphere in kubernetes
[Laoke] how should ordinary people learn technology?
Kwai 350014
Using jetpack datastore for data storage
数学知识:欧拉函数—欧拉函数
浅析 Open API 设计规范
RTMP streaming exception fast recovery scheme
WPS for thesis writing installs MathType plug-in to write mathematical formulas
How bootstrap clears floating styles
套接字socket编程
Quick sort + bubble sort + insert sort + select sort
一秒钟查看一次文件,并将文件最后一行内容结果发送至syslog服务器
转盘式视觉筛选机及其图像识别系统
Guava Cache 使用小结