[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

scrolling scroll bar by code

Posted on 2002-07-02
4
Medium Priority
?
197 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
[X]
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
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 53

Accepted Solution

by:
Ryan Chong earned 200 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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
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…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
Suggested Courses

656 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