|
-
Feb 28th, 2007, 12:24 PM
#1
Thread Starter
Addicted Member
[RESOLVED] Always on Top
I couldn't think of what I'd need to search for to find this, "always on top" always seems to have had more to do with the window than what I want:
I am making a weather-station creation program which gives you a standard weather station reading (like a circle with a line coming out of it).
However, the picture of the circle in the middle (which indicates cloud cover based on different fillings) has a box around it, which seems to swallow up anything else within it. To illustrate my point:
Code:
Here, the X is fine:
______
| X
|
|
But if it's here, the white part of the picturebox makes the X go underneath it:
______
X|
|
|
What I'd like to know is this: Is there any way to make a control always be over an image, rather than under it? When I use the "Send to back" button on the image, the control which overlaps the picture always goes underneath it, rather than logically staying on top.
How would I keep the control on top of the picture rather than under it?
-
Feb 28th, 2007, 01:33 PM
#2
Hyperactive Member
Re: Always on Top
I think if you change the .ZOrder of the controls, it will set it up properly
Picturebox1.ZOrder = 1
Label1.ZOrder = 0 (or whatever control you are using for your "X")
"0" Being the top most control
"1" Being the second control, etc..
Pardon me if I am incorrect, but I think I had to do this same thing in a project once.
-
Feb 28th, 2007, 01:34 PM
#3
Re: Always on Top
Control.ZOrder 0
so.. for a command button
Command1.ZOrder 0
JPnyc rocks!! (Just ask him!)
If u have your answer please go to the thread tools and click "Mark Thread Resolved"
-
Feb 28th, 2007, 01:52 PM
#4
Re: Always on Top
Windowed controls (CommandButton, TextBox, PictureBox, ListBox, etc) will always be higher in the ZOrder than lightweight controls (Label, Shape, Line, etc) - that could be causing your problem (since you haven't stated what controls you're using)
-
Feb 28th, 2007, 01:59 PM
#5
Re: Always on Top
good point... didnt think about lowly labels....
if you need a label try a locked texbox with no border etc.. or put the label in another picbox
JPnyc rocks!! (Just ask him!)
If u have your answer please go to the thread tools and click "Mark Thread Resolved"
-
Feb 28th, 2007, 03:13 PM
#6
Thread Starter
Addicted Member
Re: Always on Top
 Originally Posted by bushmobile
Windowed controls (CommandButton, TextBox, PictureBox, ListBox, etc) will always be higher in the ZOrder than lightweight controls (Label, Shape, Line, etc) - that could be causing your problem (since you haven't stated what controls you're using)
I'm using pictureboxes and lines. Can the zOrder do anything to aid with this?
-
Feb 28th, 2007, 03:26 PM
#7
Re: Always on Top
did you try it? it has a ZOrder setting.... see what happens when you try it
JPnyc rocks!! (Just ask him!)
If u have your answer please go to the thread tools and click "Mark Thread Resolved"
-
Feb 28th, 2007, 03:33 PM
#8
Re: Always on Top
Lines are windowless, so you'll have to put them in a picturebox (or put each one in a separate picturebox, depending on what you're doing with them).
The most difficult part of developing a program is understanding the problem.
The second most difficult part is deciding how you're going to solve the problem.
Actually writing the program (translating your solution into some computer language) is the easiest part.
Please indent your code and use [HIGHLIGHT="VB"] [/HIGHLIGHT] tags around it to make it easier to read.
Please Help Us To Save Ana
-
Feb 28th, 2007, 03:35 PM
#9
Re: Always on Top
i wanted him to try it before posting to ask if it will work....
JPnyc rocks!! (Just ask him!)
If u have your answer please go to the thread tools and click "Mark Thread Resolved"
-
Feb 28th, 2007, 04:02 PM
#10
Thread Starter
Addicted Member
Re: Always on Top
My code:
lluncyfeiriad(1).ZOrder 0
llunoctau(1).ZOrder 1
llunoctau still appears above lluncyfeiriad, which is why I asked whether it did anything (I should have actually said, sorry )
-
Mar 1st, 2007, 12:04 PM
#11
Thread Starter
Addicted Member
-
Mar 1st, 2007, 12:13 PM
#12
Hyperactive Member
Re: Always on Top
The line you are trying to move in and out of the picturebox....What you could do is cut and paste that same line directly into the Picturebox control. That will keep it within the borders and on top. Then, just move it outside of the visible parameters to make it "disappear"
-
Mar 2nd, 2007, 05:02 AM
#13
Thread Starter
Addicted Member
Re: Always on Top
That makes sense actually - (I'm not near vb6 at the moment) - I'm presuming you have to refer to the line as "picture1.line(0)"?
EDIT: Just tried it, it works
Last edited by ajames; Mar 2nd, 2007 at 03:14 PM.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|