Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Troublesome ZOrder 1

Status
Not open for further replies.

djquack

Programmer
Feb 22, 2002
2
AU
I'm trying to get a user control I downloaded to appear behind 2 image boxes withing another user control for use in a project i'm doing...

The label control (the one i want at the back) will only ever stay on top, i have tried changing it at design and run time using ZOrder properties but it dosnent work

i am wondering if someone can help, perhaps there is an API call for 'sent to back' or something i dont know....

THANX ;)
 
Try putting your lable into a frame. Set the frames border to none or whatever and then ZOrder the frame. This should do the trick for you.
 
I have a User Control that I want a picture box to go over. I add the User Control dynamically to the form - and I can not figure out a way to dynamically add this User Control to a frame (that I also, create dynamically).

Any ideas?
 
If the control has an hWnd property then you can use this method:

Code:
Private Declare Function SetParent Lib "user32" (ByVal hWndChild As Long, ByVal hWndNewParent As Long) As Long

'Place this code where you create your control
    SetParent Text1.hWnd, Frame1.hWnd
    Text1.Left = 0
    Text1.Top = 0
    Text1.Visible = True

I am sure there is a way to get the hWnd of a control if it doesn't have it as a property but I would have to dig for it.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top