home *** CD-ROM | disk | FTP | other *** search
- Xref: sparky comp.os.ms-windows.programmer.misc:975 comp.windows.ms.programmer:7332
- Newsgroups: comp.os.ms-windows.programmer.misc,comp.windows.ms.programmer
- Path: sparky!uunet!zaphod.mps.ohio-state.edu!wupost!eclnews!swarm.wustl.edu!wilcox
- From: wilcox@swarm.wustl.edu (Don Wilcox)
- Subject: Re: hiding scrollbars when not needed
- Message-ID: <1992Jul23.145055.28820@wuecl.wustl.edu>
- Sender: usenet@wuecl.wustl.edu (Usenet Administrator)
- Nntp-Posting-Host: swarm
- Organization: Washington University in St. Louis, MO
- References: <620@irst.UUCP>
- Date: Thu, 23 Jul 1992 14:50:55 GMT
- Lines: 42
-
- In article <620@irst.UUCP> dz@irst.UUCP (Massimo Dal Zotto) writes:
- >
- >I would like to know if it's possible to hide the scrollbars in a window,
- >created with the style attributes WS_VSCROLL and WS_HSCROLL, when the
- >entire document fits in the window so that scrolling is not needed.
- >I know that I could create the scrollbar controls explicitly, but this
- >requires also positioning and controlling them, so I would prefer to use
- >the standard window scrollbars if possible.
- >Thanks in advance.
-
- This is possible, simply set the ranges on the scroll bar to have 0 size. One
- big caveat -- this changes the size of the client area of the window, which
- will result in more WM_SIZE messages, which is probably what to responded to
- in the first place. I managed to get infinite loops when the user made the
- window just big enough to hold the entire contents...with scroll bars the
- window isn't big enough, so I check to see if I can remove them; I can and
- do so, get another WM_SIZE message (one for each scroll bar, the first of
- which doesn't realize the window is big enough, so it puts the scroll bar back
- in, oops more WM_SIZE messages). I solved this by not doing scroll bar checking
-
- when processing a message resulting from scroll bar removal. It works, and I'm
- happy.
-
- If there is any interest, I could probably scrounge up the code. My app displays
- pictures in a window, so the image size never changes.
-
- Don
- >
- >Massimo Dal Zotto
- >
- >+-----------------------------------------------------------------------------+
- >| Massimo Dal Zotto dz@irst.it |
- >| I.R.S.T. dz@irst.uucp |
- >| Via alla cascata, Loc. Pante' di Povo tel: +39+461+814444 |
- >| 38100 Trento - ITALY fax: +39+461+814340 |
- >+-----------------------------------------------------------------------------+
-
-
- --
- Don Wilcox | "For I am not ashamed of the Gospel of
- Washington University in St. Louis | Christ, for it is the power of salvation
- email: wilcox@swarm.wustl.edu | to all who believe."
-