`
v5qqcom
  • 浏览: 1285462 次
文章分类
社区版块
存档分类
最新评论

Scroll to the end of RichTextbox

 
阅读更多
用 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);
}
分享到:
评论

相关推荐

    C#RichTextBox 行号 与同步滚动

    实现了RichTextBox行号、同步滚动、字体大小设置不影响行号 高亮显示与智能提示后续提供...

    Unity 插件:Simple UI - Scroll View Extensions v1.0

    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

    (太吾绘卷游戏资料) bie框架(全部放入the scroll of taiwu).zip

    scrollToTop - a jQuery plugin

    One click to scroll back to the top of the webpage. http://geniuscarrier.com/scrolltotop-a-jquery-plugin/

    VB编程资源大全(英文源码 其它)

    "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 , ...

    scroll-to-index:在Flutter可滚动小部件内滚动到具有固定可变行高的索引

    import 'package:scroll_to_index/scroll_to_index.dart' ; 要获得Flutter入门方面的帮助,请查看在线。 用法 这是一个小部件级别的库,意味着您可以在任何Flutter可滚动小部件中使用此机制。 Flutter ListView的...

    scroll-to:滚动(垂直)到特定元素

    属性[data-scroll-to-this] 将此属性添加到将滚动到的元素[data-scroll-to-this="onload"] 页面加载时滚动到该元素[data-scroll-to-this="onclick"] 当属性设置为 [data-scroll-to-this-target] 的元素被点击时滚动...

    使用Element的InfiniteScroll 无限滚动组件报错的解决

    TypeError: Failed to execute ‘observe’ on ‘MutationObserver’: parameter 1 is not of type ‘Node’ InfiniteScroll的更多用法element官网 二、解决办法 给需要使用 InfiniteScroll 的元素或者它的父级...

    A Programmer's Guide to C# 5.0 pdf

    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. ...

    滚动到顶部按钮「Scroll To Top Button」-crx插件

    添加一个滚动到顶部/底部的按钮。 滚动到顶部按钮是Google Chrome,... ---滚动到Opera和Yandex.Browser的顶部按钮:https://addons.opera.com/extensions/details/scroll-to-top-button/滚动到Firefox的顶部按钮:...

    The PACSview SW package

    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 ...

    Android代码-Flutter下拉刷新和上拉加载组件。

    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...

    VB编程资源大全(英文源码 控件)

    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...

    EhLib 9.1.038 for D7-XE-10.2

    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. ...

    VB编程资源大全(英文源码 表单)

    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 ...

    微软内部资料-SQL性能优化3

    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 that shows how to make the form centere

    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

    Learning Cocos2d-JS Game Development

    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 ...

    VB编程资源大全(英文源码 API)

    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 ...

    DBGridPro new

    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...

Global site tag (gtag.js) - Google Analytics