home *** CD-ROM | disk | FTP | other *** search
- Hi,
-
- It appears that the only reason VB doesn't support overlapping controls is
- that the WS_CLIPSIBLINGS style bit is not set for VB controls. Setting this
- style bit tells Win3 to clip overlapping child controls so that they are
- displayed correctly and don't interfere with each other. The order in which
- child windows are displayed is determined by their relative locations in the
- Win3 Window Manager List. A window which is higher up on this list will appear
- in front of any windows that are lower down in the list. CLIPSIB demonstrates
- how to set the WS_CLIPSIBLINGS style bit for all of a Form's windows and
- several API functions that you can use to access and manipulate the Window
- Manager List.
-
- I think you will be amazed at what you can do simply by setting this bit for
- all of a Form's child windows (VB controls).
-
- CLIPSIB contains three demonstrations of the added power that setting this bit
- provides. In the upper left of the Form are a group of 4 overlapping list
- boxes. Clicking any of the list boxes pops it in front of the other boxes so
- you can make a selection. In the upper right of the Form are 3 small Picture
- Controls that will be loaded with the Win3 bitmap named PYRAMID.BMP and a
- larger Picture Control that will be loaded the the Win3 bitmap named
- CHESS.BMP. The large Picture Control also has a Command Button on it. You can
- use your mouse to move the small pictures on top of the large one and to
- scroll the large picture -under- the small ones.
-
- In the lower right of the Form is a simulation of a FIND Dialogue Box similar
- to the ones found in VB and other Win3 programs. You can drag this box around
- by its title bar. The special feature of this set of controls is that they
- are *always* displayed on top of all other controls. Try dragging the Find box
- on top of the group of list boxes and then click on the list boxes. Note that
- even though the list boxes re-arrange themselves, they never pop-up in front
- of the Find Box.
-
- CLIPSIB runs in the VB environment, but the performance is *very* slow. You
- should load the program into VB and then create and EXE file and run the EXE
- file. The performance improvement is dramatic!!!
-
- The credit for discovering the significance of WS_CLIPSIBLINGS must go
- completely to Daniel Appleman, the owner of DesaWare and creator of the Custom
- Control Factory VB Add-on Toolkit. Dan took the time to examine my first
- attempt (in which I only manipulated the Window Manager List to get VB to
- display overlapping controls correctly) and then very nicely explain that I
- was out to lunch.<g> After Dan explained how things *really* work with Win3, I
- was off to the races.
-
- But Dan wasn't the only one who contributed to this program. Thanks must also
- go to Ted Young and Jonathan Zuk who also took the time to look at my first
- attempt. In fact, Jonathan mentioned WS_CLIPSIBLINGS, but his suggestion went
- in one eye and out the other. So much for my powers of perception.<g>
-
- This program requires the Win3 bitmaps PYRAMID.BMP and CHESS.BMP. They come
- with Win3 and should be in your Win3 directory. The program also makes
- extensive use of a custom DLL named CTLHWND.DLL which was written by Jonathan
- Zuk. Because the DLL is tiny, I've included it with the demo rather than make
- you track it down in the MSBASIC Libraries.
-
- Although Dan, Ted and Jonathan made significant contributions to this program,
- I am solely responsible for any errors, omissions, bugs, etc. If you have any
- problems with the program, I'm the guy you should jump on.<g>
-
- CLIPSIB.BAS is FreeWare. Do what you like with it and have some fun.
-
- Keith Funk (CIS 72240, 2020)
- Nov. 3, 1991