Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sun-barr!olivea!samsung!rex!uflorida!gatech!hubcap!ncrcae!ncr-sd!iss-rb!booboo!davel From: davel@booboo.SanDiego.NCR.COM (David Lord) Newsgroups: comp.windows.ms.programmer Subject: Re: Help with scrollbars.... Keywords: Scrollbars Message-ID: <1991Apr11.170114.10545@SanDiego.NCR.COM> Date: 11 Apr 91 17:01:14 GMT References: <1991Apr10.213253.20233@ulowell.ulowell.edu> Sender: rock1@SanDiego.NCR.COM Reply-To: davel@booboo.SanDiego.NCR.COM (David Lord) Organization: NCR Corporation, Rancho Bernardo Lines: 45 In article <1991Apr10.213253.20233@ulowell.ulowell.edu> dpelland@hawk.ulowell.edu (David Pelland) writes: < | <------------------------------------ Unfortunately you have to handle most of it yourself. As a fairly new Windows programmer who just worked on this same problem I can tell you that you should keep in mind: Scroll bars are the work of the devil and are certain to make your life miserable forever. Actually this one is a fairly easy problem. First you always have to make sure your child window stays within your parent window. This means adjusting the size with MoveWindow whenever the parent gets WM_SIZE. If you don't do this your scroll bars will be off somewhere where you can't get at them. Don't forget to adjust the scroll range (SetScrollRange) at the same time. Now you just have to catch the various scroll messages and take appropriate actions, ie. scroll the window, set the button position, and keep track of the x & y offset amounts so you can adjust for the new position when you handle a WM_PAINT message. See, what did I tell you, practically trivial :-). Dave Lord