🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.os.ms-windows.programmer.tools
Article #809

Re: VB 2.0 bug?

#809
From: Joe Robison
Date: Mon, 25 Jan 1993 04:37
41 lines
2517 bytes
In article <1993Jan18.225912.9347@hssiarl.uucp> ford@hssiarl.uucp wrote:
> 
> 	An application written in VB 1.0 uses labels overlapping
> picture boxes, works correctly labels are no top at run time., when
> Converted to erted to VB 2.0 the labels are covered up by picture boxes.
> The labels where visible in 1.0 on top of the picture boxes.
> Tried in edit menu to push label to front, also tried using
> Z-order to push label to front. Neither method worked.
> Tried pushing picture box into background, still not correct.
> Works with all other controls correctly only labels are not 
> controllable in front or back of picture box.
> 
> Anyone else seen this problem in 2.0. Any hints or solutions
> to the problem. Please post answer.

This isn't a bug, but a side-effect that you might consider undesirable.
In Visual Basic 1.0, labels were actual "windowed" controls (they were
real child windows).  As a consequence, they tended to consume a fair
amount of system resources.  In Visual Basic 2.0, they aren't windows
but instead are GDI objects that Visual Basic redraws as needed.  Like
the other graphical objects in Visual Basic 2.0 (the shape, Image, and
Line controls), they have their own Z-order that lies behind the other,
non-graphical (or "windowed") controls.  As a result, a label will 
always be under a text box, frame, or -- as you discovered -- a picture
box.  In the case of frame or picture box, however, there is an easy
workaround.  Simply draw the label on the picture box, instead of
drawing it separately and then dragging it over the picture box.  By
drawing a control on a picture box or frame, you make the picture box
or frame contain the control you just drew.  This is how you put option
buttons in frames as well.  If you have labels that already exist, you
can get them "inside" a picture box by cutting them to the clipboard,
then selecting the picture box and pasting.  Once they are contained
by the picture box, they will appear on top of it and as you move the
picture box they will move with it.

Hope this helps.

--
Joe Robison
joero@microsoft.com
Not A Microsoft Spokeshuman
Technical Details
Message-ID: <1993Jan25.043710.5@microsoft.com>
Path: arc1-ca.pugleaf.net!sparky!uunet!microsoft!hexnut!joero
References: <1993Jan18.225912.9347@hssiarl.uucp>

Show Full Headers
Complete Article Headers
Newsgroups: comp.os.ms-windows.programmer.tools
Path: arc1-ca.pugleaf.net!sparky!uunet!microsoft!hexnut!joero
From: joero@microsoft.com (Joe Robison)
Subject: Re: VB 2.0 bug?
Message-ID: <1993Jan25.043710.5@microsoft.com>
Date: 25 Jan 93 04:37:10 GMT
Organization: Microsoft Corp.
References: <1993Jan18.225912.9347@hssiarl.uucp> 
Distribution: usa
Lines: 42