Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

scrolling scroll bar by code

Posted on 2002-07-02
4
190 Views
Last Modified: 2010-05-02
i have a mdi form which contain a child form,i wish to know how can i use coding to move the scroll bar of the mdi form so the user no need to use mouse to scroll down manually to see the whole content of the child form.. please gave me some example to refer to.. Thanks
0
Comment
Question by:tayleeming
4 Comments
 
LVL 143

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 7124330
What about this example (code for the MDI Child):

Private Sub Form_DblClick()
  Me.Top = 0
  Me.Left = 0
End Sub

CHeers
0
 
LVL 50

Accepted Solution

by:
Ryan Chong earned 50 total points
ID: 7126062
Try use SendMessage API:

use the SendMessage API to scroll the form to top:

http://www.mvps.org/vbnet/code/subclass/lvscrollbars.htm

Basically, what you should look is the:

Private Const SB_LINEUP = 0
Private Const SB_LINEDOWN = 1
Private Const SB_PAGEUP = 2
Private Const SB_PAGEDOWN = 3
Private Const SB_THUMBPOSITION = 4
Private Const SB_THUMBTRACK = 5
Private Const SB_TOP = 6
Private Const SB_BOTTOM = 7
Private Const SB_ENDSCROLL = 8

Private Declare Function SendMessage Lib "user32" _
  Alias "SendMessageA" _
 (ByVal hWnd As Long, _
  ByVal wMsg As Long, _
  ByVal wParam As Long, _
  lParam As Any) As Long

and

Call SendMessage(ListView2.hWnd, _
                            WM_VSCROLL, _
                            wParam, _
                            ByVal 0&)
Modify the parameter to

Call SendMessage(FormName.hWnd, _
                            WM_VSCROLL, _
                            B_BOTTOM , _
                            ByVal 0&)


Hope this helps
0
 
LVL 49

Expert Comment

by:DanRollins
ID: 7971214
Hi tayleeming,
It appears that you have forgotten this question. I will ask Community Support to close it unless you finalize it within 7 days. I will ask a Community Support Moderator to:

    Accept ryancys's comment(s) as an answer.

tayleeming, if you think your question was not answered at all or if you need help, just post a new comment here; Community Support will help you.  DO NOT accept this comment as an answer.

EXPERTS: If you disagree with that recommendation, please post an explanatory comment.
==========
DanRollins -- EE database cleanup volunteer
0
 

Expert Comment

by:SpideyMod
ID: 8018740
per recommendation

SpideyMod
Community Support Moderator @Experts Exchange
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

856 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question