Scroll to the end of RichTextbox
来源:互联网 发布:unity3d集成百度地图 编辑:程序博客网 时间:2024/05/17 23:11
用 RichTextBox 做聊天内容显示的哥们,估计都遇到过这个问题。
使用SendMessage API向RichTextBox控件发送消息是最简单的一种解决方法。
使用SendMessage API向RichTextBox控件发送消息是最简单的一种解决方法。
using System.Runtime.InteropServices;
[DllImport("User32.dll",EntryPoint="SendMessage")]
private static extern int SendMessage(
IntPtr hWnd, // handle to destination window
uint Msg, // message
uint wParam, // first message parameter
uint lParam // second message parameter
);
private const int WM_VSCROLL = 0x0115;
private const int SB_BOTTOM = 7;
private void btnSend_Click(object sender, System.EventArgs e)
{
this.richTextBox1.AppendText("1");
SendMessage(this.richTextBox1.Handle, WM_VSCROLL, SB_BOTTOM, 0);
}
[DllImport("User32.dll",EntryPoint="SendMessage")]
private static extern int SendMessage(
IntPtr hWnd, // handle to destination window
uint Msg, // message
uint wParam, // first message parameter
uint lParam // second message parameter
);
private const int WM_VSCROLL = 0x0115;
private const int SB_BOTTOM = 7;
private void btnSend_Click(object sender, System.EventArgs e)
{
this.richTextBox1.AppendText("1");
SendMessage(this.richTextBox1.Handle, WM_VSCROLL, SB_BOTTOM, 0);
}
- Scroll to the end of RichTextbox
- The Importance of the End to End Automation Testing Tool
- Appending to the End of a File
- by the end of, at the end of , in the end , to the end 的区别与用法
- Scroll automatically to the bottom of spark TextArea
- Use jQuery to scroll to the bottom of a div with lots of text
- End of the "Road to DataStage Certification" D
- before we get to the end of our block
- How to enter an End-Of-File from the keyboard
- persist to the end
- Deep Fisher Kernels – End to End Learning of the Fisher Kernel GMM Parameters(泛读)
- The minimum number of elements to reach the end of an array
- The color chooser class, you could slide the scroll bars to get the specific numbers of the color
- End-to-end internationalization of Web applications
- Basics of End-to-End Workload Analysis
- nike factory is expected to increase to 10 by the end of this year
- CRT detected that the application wrote to memory after after the end of heap buffer
- Following extensions directory contents added to the end of the classpath
- Application.OpenForms
- 被忽视的 Application
- 关闭提示 & 关闭操作系统
- RichtextBox 插入图片
- Application.Exit()
- Scroll to the end of RichTextbox
- 初学必读:61条面向对象设计的经验原则
- 控制系统服务 (Windows Services)
- 信使服务 (Messenger)
- javascript操作表格对象
- 实例讲解Silverlight与AJAX的融合
- 秋雨漏更夜,琴音动心痕
- 求助:怎样可以在下拉式菜单中列出数据库中所有关于该列的项?
- 程序员创业失败的原因