|
-
August 15th, 2001, 10:54 AM
#1
Still not working
Hello,
Here is the API function am using. It will move the Grid scroll bar (thumb) but not the contents of the Grid.
Public Declare Function SetScrollPos Lib "user32" (ByVal hwnd As Long, ByVal nBar As Long, ByVal nPos As Long, ByVal bRedraw As Long) As Long
**************************************
Private Sub Command1_Click()
Dim x As Long, y As Long, z As Long
y = Grid1.hwnd
x = 50
z = SetScrollPos(y, 1, x, 1)
End Sub
***************************************
Thanks
Hisham
Thank You, Hisham
-
August 15th, 2001, 11:39 AM
#2
Re: Still not working
that's because what you are doing is just setting the position of the scrollbar, which causes nothing to happen but the scrollbar to move. what you are probably wanting to happen is the events associated with moving a scrollbar which is the scroll event. you will need to use the SendMessage API function with appropriate parameters to send the grid a scroll message. the entire grid should then scroll.
hope it helps.
-obiwan
-
August 15th, 2001, 12:02 PM
#3
Re: Still not working
Could you please tell me what proper message I can send to a flexgrid scroll bar?
I really appreciate your responses.
Thanks
Hisham
Thank You, Hisham
-
August 15th, 2001, 08:40 PM
#4
Re: Still not working
the flexgrid control is an ActiveX control, and i've found its underlying messages aren't documented. you might be able to figure out what message is being sent by subclassing the control or placing a call to the GetMessage API function inside the scroll event of the flexgrid control.
that's a lot of work. might i ask why you're trying to force the grid to scroll ?
-obiwan
-
August 16th, 2001, 02:47 AM
#5
Re: Still not working
Using the window message investifgation tool I posted on palnet source code two days ago I have discovered that if you send a WM_VSCROLL message to an MSFlexGrid control it moves the scrollbar and contents.
private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (byval hwnd as Long, byval wMsg as Long, byval wParam as Long, lParam as Long) as Long
private Const WM_VSCROLL = &h115
'to scroll a grid upwards, wParam is 0
public Sub ScrollGridUp(byval fg as MSFlexGrid)
Dim lRet as Long
lRet = SendMessage(fg.hwnd, WM_VSCROLL,0,0)
End Sub
'to scroll a grid down, wParam is 1
public Sub ScrollGridDown(byval fg as MSFlexGrid)
Dim lRet as Long
lRet = SendMessage(fg.hwnd, WM_VSCROLL,1,0)
End Sub
Hope this helps,
Duncan
-------------------------------------------------
Ex. Datis: Duncan Jones
Merrion Computing Ltd
http://www.merrioncomputing.com
Check out the new downloads - ImageMap.ocx is the VB control that emulates an HTML image map, EventVB.OCX for adding new events to your VB form and adding System Tray support simply, MCL Hotkey for implemenmting system-wide hotkeys in your application...all with source code included.
-
August 16th, 2001, 07:48 AM
#6
Re: Still not working
thx a lot for this post. gonna go grab ur tool 
-obiwan
-
August 16th, 2001, 08:23 AM
#7
Re: Still not working
Thank you very much. That's what I was looking for. Thank you again.
Thanks
Hisham
Thank You, Hisham
-
August 16th, 2001, 08:24 AM
#8
Re: Still not working
Thak you, that worked.
Thanks
Hisham
Thank You, Hisham
-
August 16th, 2001, 08:38 AM
#9
Re: Still not working
i forgot ... we could have used Microsoft Spy++ 
-
August 16th, 2001, 08:43 AM
#10
Re: Still not working
Yes - spy allows you to watch messages, but the tool posted on PSC (I would post it here if there was a method of doing so) also allows you to send the message to watch its effect.
HTH,
Duncan
-------------------------------------------------
Ex. Datis: Duncan Jones
Merrion Computing Ltd
http://www.merrioncomputing.com
Check out the new downloads - ImageMap.ocx is the VB control that emulates an HTML image map, EventVB.OCX for adding new events to your VB form and adding System Tray support simply, MCL Hotkey for implemenmting system-wide hotkeys in your application...all with source code included.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|