Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

ZOrder Problem in VB6

Posted on 2004-08-02
5
Medium Priority
?
3,985 Views
Last Modified: 2008-03-04
Hi!
I have A picturebox and several labels in my app, the labels are NOT children of the picturebox.
I want to load the picturebox during runtime first, and then load the labels, onto it, but when I load them they are loaded behind the picturebox and I cant see them.
I tried using Zorder(1) to position the picturebox behind the labels but it wouldn't work. Why?
And how do I load the labels onto the box so they will be in the front without making them the children of the picturebox?
Thanks.
0
Comment
Question by:NightBlader
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
5 Comments
 
LVL 4

Expert Comment

by:SSSoftware
ID: 11693030
Labels and lines are basic constructs and reside at a different drawing plane that more extensive controls.

Therefore: using the ZOrder has no effect. I'm not event sure it has an effect within the drawing plane.

I Suggest you use another picturebox to to lable your picture.

Ed
0
 

Author Comment

by:NightBlader
ID: 11693075
Then there is no way to bring them to the front?
0
 
LVL 17

Accepted Solution

by:
zzzzzooc earned 500 total points
ID: 11693189
Why wouldn't you want them to be children of the PictureBox? You can always toggle between the Labels' containers.

Form1:
------------
Option Explicit

Private ctrlLabel As Label
Private Sub Command1_Click()
    'set the label's container back to the form...
    Set ctrlLabel.Container = Form1
End Sub
Private Sub Form_Load()
    With Picture1
        .Left = 0
        .Top = 0
    End With
    Set ctrlLabel = Me.Controls.Add("VB.Label", "MyLabel1")
    ctrlLabel.Caption = "MyLabel1"
    ctrlLabel.Visible = True
    Set ctrlLabel.Container = Picture1
End Sub
0
 

Author Comment

by:NightBlader
ID: 11693299
I didnt know I could change the container of the label at any time, I didnt want it to be a child because I have to change it's container.
I suppose it will work, Ill try it now, Thanks!
0
 

Author Comment

by:NightBlader
ID: 11693330
Yep, it works, thanks!
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Suggested Courses

704 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question