用 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);
}
分享到:
相关推荐
实现了RichTextBox行号、同步滚动、字体大小设置不影响行号 高亮显示与智能提示后续提供...
Smooth and eased snapping (works great whether dragging using touch, mouse or scroll wheel) and user input dependent animation make it possible to use the Scroll Rect in a wide range of scenarios such...
(太吾绘卷游戏资料) bie框架(全部放入the scroll of taiwu).zip
One click to scroll back to the top of the webpage. http://geniuscarrier.com/scrolltotop-a-jquery-plugin/
"This technique allows a program to save hierarchical information like the data in a TreeView in a way that is easy to understand."<END> 11 , OLE.zip Demonstrates the use of OLE.<END> 12 , ...
import 'package:scroll_to_index/scroll_to_index.dart' ; 要获得Flutter入门方面的帮助,请查看在线。 用法 这是一个小部件级别的库,意味着您可以在任何Flutter可滚动小部件中使用此机制。 Flutter ListView的...
属性[data-scroll-to-this] 将此属性添加到将滚动到的元素[data-scroll-to-this="onload"] 页面加载时滚动到该元素[data-scroll-to-this="onclick"] 当属性设置为 [data-scroll-to-this-target] 的元素被点击时滚动...
TypeError: Failed to execute ‘observe’ on ‘MutationObserver’: parameter 1 is not of type ‘Node’ InfiniteScroll的更多用法element官网 二、解决办法 给需要使用 InfiniteScroll 的元素或者它的父级...
After a couple of introductory chapters, the book progresses from the simpler C# features to the more complex ones. You can read the chapters in order, working your way through the entire language. ...
添加一个滚动到顶部/底部的按钮。 滚动到顶部按钮是Google Chrome,... ---滚动到Opera和Yandex.Browser的顶部按钮:https://addons.opera.com/extensions/details/scroll-to-top-button/滚动到Firefox的顶部按钮:...
It's also possible to scroll through all images according defined sequences, or to print all images of one study at once. There is also a feature for automatically printing of studies, when arriving ...
a widget provided to the flutter scroll component drop-down refresh and pull up load.support android and ios. If you are Chinese,click here(中文文档) (Suspend maintenance until 12 months after the end...
Scroller.zip This is a Control Container, it's like a frame control but it lets you scroll the content up and down...<END> 11 , TrayArea.zip This control lets you add your icon to the System...
The EhLib set contains components and classes for various versions of the Delphi programming language and to increase the capacity of the user’s database database software to interact with users. ...
It takes two images to shape the form, then blits the "face" onto the form also.<END> 3 , noclose.zip This demonstrates how to remove the "X" located on the top of your form, while keeping the ...
At the end of this module, you will be able to: Discuss how lock manager uses lock mode, lock resources, and lock compatibility to achieve transaction isolation. Describe the various transaction...
This is a VB project ... It also makes the form scroll of the screen and end. I have included A text file with the code for people who cant load vb6 projects and I have also included and .exe of the proj
By the end of the book, you'll have created a complete cross-platform game right from scratch, featuring leader boards and third-party adverts, complete with the final polish every game should ...
It shows how to create, store and save a password to the registry and also encrypts it to keep out prying eyes.<END> 32,delay.zip This is a rough translation of the GetTickCount API and ...
Multilevel layout of column titles - fields of dataset record can be represented as several rows in the grid to enhance the display of information to end-users at runtime. Column layout can be easily...