in

SDT Community Server

SDT Forums, Blogs, Photos server.

Floating Heart

No description is bad.

Browse by Tags

All Tags » Win.Net » Simple Projects (RSS)
Sorry, but there are no more tags available to filter with.
  • Scroll to Bottom of TextBox

    有时我们想在textbox内容改变后,自动滚动到最后一行。一下就是解决方案: 方法1: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 [DllImport( "User32.dll" , CharSet = CharSet.Auto, EntryPoint = "SendMessage" )] static extern IntPtr SendMessage(IntPtr hWnd, uint Msg, IntPtr wParam,IntPtr lParam); public static void ScrollToBottom(TextBoxBase tb) { const int WM_VSCROLL = 277; const int SB_BOTTOM = 7; IntPtr ptrWparam = new IntPtr(SB_BOTTOM); IntPtr ptrLparam = new IntPtr(0); SendMessage(tb.Handle, WM_VSCROLL, ptrWparam, ptrLparam); } 方法2: 1 2 3 4 5 public...
    Posted Jun 15 2007, 08:41 AM by wicky with | with no comments
    Filed under: ,
Copyright SDT, 2006-2009. All rights reserved.