home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #3 / NN_1993_3.iso / spool / comp / os / mswindo / programm / tools / 2220 < prev    next >
Encoding:
Text File  |  1993-01-25  |  2.4 KB  |  54 lines

  1. Newsgroups: comp.os.ms-windows.programmer.tools
  2. Path: sparky!uunet!microsoft!hexnut!joero
  3. From: joero@microsoft.com (Joe Robison)
  4. Subject: Re: VB 2.0 bug?
  5. Message-ID: <1993Jan25.043710.5@microsoft.com>
  6. Date: 25 Jan 93 04:37:10 GMT
  7. Organization: Microsoft Corp.
  8. References: <1993Jan18.225912.9347@hssiarl.uucp> 
  9. Distribution: usa
  10. Lines: 42
  11.  
  12. In article <1993Jan18.225912.9347@hssiarl.uucp> ford@hssiarl.uucp wrote:
  13. >     An application written in VB 1.0 uses labels overlapping
  14. > picture boxes, works correctly labels are no top at run time., when
  15. > Converted to erted to VB 2.0 the labels are covered up by picture boxes.
  16. > The labels where visible in 1.0 on top of the picture boxes.
  17. > Tried in edit menu to push label to front, also tried using
  18. > Z-order to push label to front. Neither method worked.
  19. > Tried pushing picture box into background, still not correct.
  20. > Works with all other controls correctly only labels are not 
  21. > controllable in front or back of picture box.
  22. > Anyone else seen this problem in 2.0. Any hints or solutions
  23. > to the problem. Please post answer.
  24.  
  25. This isn't a bug, but a side-effect that you might consider undesirable.
  26. In Visual Basic 1.0, labels were actual "windowed" controls (they were
  27. real child windows).  As a consequence, they tended to consume a fair
  28. amount of system resources.  In Visual Basic 2.0, they aren't windows
  29. but instead are GDI objects that Visual Basic redraws as needed.  Like
  30. the other graphical objects in Visual Basic 2.0 (the shape, Image, and
  31. Line controls), they have their own Z-order that lies behind the other,
  32. non-graphical (or "windowed") controls.  As a result, a label will 
  33. always be under a text box, frame, or -- as you discovered -- a picture
  34. box.  In the case of frame or picture box, however, there is an easy
  35. workaround.  Simply draw the label on the picture box, instead of
  36. drawing it separately and then dragging it over the picture box.  By
  37. drawing a control on a picture box or frame, you make the picture box
  38. or frame contain the control you just drew.  This is how you put option
  39. buttons in frames as well.  If you have labels that already exist, you
  40. can get them "inside" a picture box by cutting them to the clipboard,
  41. then selecting the picture box and pasting.  Once they are contained
  42. by the picture box, they will appear on top of it and as you move the
  43. picture box they will move with it.
  44.  
  45. Hope this helps.
  46.  
  47. --
  48. Joe Robison
  49. joero@microsoft.com
  50. Not A Microsoft Spokeshuman
  51.  
  52.