发信人: ldlee()
整理人: winsy(2003-03-05 15:56:15), 站内信件
|
【 在 woodee (鲲) 的大作中提到: 】
: 我正在用VB做一个应用程序,其中一个窗体里有一个RichTextBox,里面
: 的Text是从一个文本文件aa.txt中读出的文本,文本很长,但根据应用的要
: 求,不能有横向和纵向的滚动条,所以我想用两个按钮Button来控制文本框
: 的前后翻页,请问应该怎么写Button_Click?
: .......
下面的可以控制逐行滚动,
Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" _
(ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lPa ram As Long) As Long
Private Const EM_LINESCROLL = &HB6
Private Declare Function PutFocus Lib "user32" Alias "SetFocus" _
(ByVal hwnd As Long) As Long
Rem 参数:hwnd为Text或RichTextBox的Hwnd,hScroll为水平方向的变量Rem Vscr oll为垂直方向变量,可操作则返回True
Private Function ScrollText(hwnd As Long, ByVal hScroll As Long, ByVal VScroll As Long) As Boolean
ScrollText = SendMessage(hwnd, EM_LINESCROLL, ByVal hScroll, ByVal VScroll)
PutFocus hwnd
End Function
-- ******************
欢迎到东东的家看看
http://vb.winterlee.yes8.com
啊、
你想要呀,
你想要说清楚就行了吗!
※ 来源:.月光软件站 http://www.moon-soft.com.[FROM: 202.99.179.1]
|
|