Re: Scroll dialog programmatically

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



Have you tried simulating a key press on the control you want to have focus?
SendMessage(hcontrol,WM_KEYUP,(WPARAM)VK_UP,0);



Lisa Pearlson wrote:
My dialog resource has WS_VSCROLL, .. I can't get everything to fit on the screen so my dialog displays a scroll bar. When I set focus to a control outside the visible area, using the key pads, the control scrolls into view.
But when I set focus programmatically to a control outside the visible area (using SetFocus()) then the dialog doesn't scroll.
I want to scroll back to top.


I tried to use SetScrollPos() and it adjusts the scroll bar only, but doesn't scroll the dialog box content.
I tried posting WM_VSCROLL to the dialog box itself, but nothing happens.


Any clues?

Lisa


.



Relevant Pages

  • Problem with Horizontal scroll bar in CListCtrl
    ... I am trying to remove the horizontal scrollbar from a CListCtrl-derived control, ... but the horizontal scroll bar will not go away! ... on" the horizontal scroll bar. ...
    (microsoft.public.vc.mfc)
  • Re: List box not showing all records
    ... "Graham R Seach" wrote: ... Perhaps that instance of the control is corrupt. ... If I open the form and click on the scroll bar to ...
    (microsoft.public.access.forms)
  • Re: Need to use VBA to put image on a form
    ... Earl Kiosterud ... the OP can place an Image control, ... this way the form's native ScrollBars can be used to scroll the contents of the Image ... Note: Some folks prefer bottom-posting. ...
    (microsoft.public.access.formscoding)
  • Re: ActiveX Calendar control on a modal form
    ... ActiveX controls don't "live" in FoxPro's real estate. ... I had vertical scroll bar activated for the ... scroll bar was one of the first things I added. ... You appear to have copied the control from another form. ...
    (microsoft.public.fox.helpwanted)
  • Re: Painting my own scroll bars
    ... > the paint events, and if they are going to a scroll bar, do ... adjusted the width of the scroll bar to suit my "Touch ... > AutoScroll to false and associate the control I wanted to scroll with my ... > and User Interface development. ...
    (microsoft.public.dotnet.framework.windowsforms)