By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
432,009 Members | 1,767 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 432,009 IT Pros & Developers. It's quick & easy.

Vertical scroll position of a rich textbox control

P: n/a
Ted
I am trying to return the vertical scroll position of a rich textbox
control using Access 2000. It seems to work for the horizontal scroll
bar, but not the vertical. Code follows:

Option Explicit
Private Declare Function GetScrollPos Lib "user32" (ByVal hwnd As
Long, ByVal nBar As Long) As Long
Private Declare Function GetFocus Lib "user32" () As Long
Private Const SB_VERT = 0
'****************some event
Dim lPosition As Integer
Dim lHandle As Long
Me.axcEsign.SetFocus
lHandle = GetFocus()
'MsgBox lHandle

lPosition = GetScrollPos(lHandle, SB_VERT)
MsgBox lPosition

Any ideas?
Thanks
Nov 13 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
If I remember correctly, GetFocus would return the handle for the
ActiveX reflector window and not handle for the RTF window itself. Just
use the hWnd property exposed by the RTF control itself.

--

HTH
Stephen Lebans
http://www.lebans.com
Access Code, Tips and Tricks
Please respond only to the newsgroups so everyone can benefit.
"Ted" <st******@ceva.net> wrote in message
news:39**************************@posting.google.c om...
I am trying to return the vertical scroll position of a rich textbox
control using Access 2000. It seems to work for the horizontal scroll
bar, but not the vertical. Code follows:

Option Explicit
Private Declare Function GetScrollPos Lib "user32" (ByVal hwnd As
Long, ByVal nBar As Long) As Long
Private Declare Function GetFocus Lib "user32" () As Long
Private Const SB_VERT = 0
'****************some event
Dim lPosition As Integer
Dim lHandle As Long
Me.axcEsign.SetFocus
lHandle = GetFocus()
'MsgBox lHandle

lPosition = GetScrollPos(lHandle, SB_VERT)
MsgBox lPosition

Any ideas?
Thanks


Nov 13 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.