winform中richTextBox滚动条问题 如何使winform中richTextBox滚动条自己向下按一定的速度进行移动?在线等高手解答 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 [DllImport("user32")] private static extern int SendMessage(IntPtr hWnd, int Msg, int wParam, int lParam); private void timer1_Tick(object sender, EventArgs e) { SendMessage(this.richTextBox1.Handle, 0x0115, 1, 0); } using System.Runtime.InteropServices;timer控件的时间间隔自己设置一下就好了 不想用SendMessage()int lineIndex;private void timer1_Tick(object sender, EventArgs e) { int charIndex = this.richTextBox1.GetFirstCharIndexFromLine(lineIndex++); this.richTextBox1.Select(charIndex, 0); this.richTextBox1.ScrollToCaret(); int lineCount = this.richTextBox1.GetLineFromCharIndex(this.richTextBox1.TextLength - 1); if (lineIndex > lineCount) { timer1.Stop(); }} 源代码管理 链接 URL参数问题,可以编码,也可以加密 求思路,重写计时收费软件 请教 Socket Receive(同步堵塞模式)下,实收值不等于buffer的问题 winForm中点击一个按钮,弹出一个小窗口,怎么实现啊? 一个调水问题,本人菜鸟,求高手帮助. 求一网站源码源码 如何判断用户输入时间样式 c# 打包时的奇怪问题 如何将char[] 转变成 String ? C# 串口通讯 接收字符有丢失! listview中打开文件的问题
private static extern int SendMessage(IntPtr hWnd, int Msg, int wParam, int lParam);
private void timer1_Tick(object sender, EventArgs e)
{
SendMessage(this.richTextBox1.Handle, 0x0115, 1, 0);
}
timer控件的时间间隔自己设置一下就好了
private void timer1_Tick(object sender, EventArgs e)
{ int charIndex = this.richTextBox1.GetFirstCharIndexFromLine(lineIndex++);
this.richTextBox1.Select(charIndex, 0);
this.richTextBox1.ScrollToCaret();
int lineCount = this.richTextBox1.GetLineFromCharIndex(this.richTextBox1.TextLength - 1);
if (lineIndex > lineCount)
{
timer1.Stop();
}
}