home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #16 / NN_1992_16.iso / spool / comp / os / mswindo / programm / misc / 975 < prev    next >
Encoding:
Internet Message Format  |  1992-07-23  |  2.6 KB

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