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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to bring control on top

Status
Not open for further replies.

abbasaif

ISP
Oct 8, 2018
89
AE
Hi,

I am facing a problem in showing the container to the front of all.
In one container I placed an image and in click event of it I resize the container according to the grid inside the same container.
Everything is working except when I placed this image within another container, it is not going out the border of the container.
How can I show it to required size.

Please find the image (Img1.gif), (it is what I am facing)
Please find the image (Img2.gif), (which is required)

Kindly suggest me.

Thanks

Abbasaif

img1_rnz8m5.gif

img2_io2g3j.gif
 
Olaf,

Thanks of explication. Since in the code I presented and in the code you changed there is no container inside an other, there is no nested containers in either code.

As for the functionality, let us wait what mr. Abbasaif has to say, pending that, this topic is closed for me.

Regards,

Koen
====
 
Yes, there are no nested containes in the demos of working examples, because they are working. Simple enough?

Aa this works for us, but not in his case, I conclude his containers are nested. Or the case would already be solved by Griffs first answer, but Abbassaif said that didn't work for him.

Bye, Olaf.

Olaf Doschke Software Engineering
 
Hi

Thanks everyone for the time sharing for this.

Let me explain with the help of images.

1. In fig 1. It is actually a container. The size of the container is equal to the size of image (Search).
2. From fig 2. to fig 4 when the image is click it resize accordingly.
3. After getting the result, when image is click it return to the original size.

The problem arise when I keep this container inside any other container and it is not showing outside the parent container.

What is the alternate of this?

Please suggest.

Thanks

Abbassaif

fig1_jtqlfi.gif

fig2_vfge3x.gif

fig3_lnnbzy.gif

fig4_anvcj7.gif

fig5_s3fmd3.gif
 
Mr. Abassaif,

despite your pictures, it is not clear, to me at least. Would you be able to upload the form?

Rgds,

Koen
 
What you've described is the way containers work. You cannot show a contained object outside the bounds of its container. You could set up code to resize the container while showing your other container and then to size it back when done.

Tamar
 
If you would illustrate what the exact borders of your containers are, simply be setting it to bordercolor red and bordersize 1, it wouold perhaps become more apparent what you actually do.

But one thing is for sure: You can't have containers stick out of a smaller container.

>when I keep this container inside any other container and it is not showing outside the parent container.
Yes. Exactly. And there is no setting doing this. The parent container needs to grow larger to be able to see the bigger container inside. OR don't put a larger conteirn inside a smaller container, just position it at the same coordinates, but on top in z-order.

Bye, Olaf.

Olaf Doschke Software Engineering
 
Hi

The parent container needs to grow larger to be able to see the bigger container inside. OR don't put a larger conteirn inside a smaller container, just position it at the same coordinates, but on top in z-order.

The parent containers contains other objects also, like date, customer code, name etc. So, does not looks good to resize the parent container.

Thanks

Abbassaif

 
You have to position the part of what you want to see of the inside to be at position (0,0) in the parent container. And then you HAVE TO resize the container to the size of the thing you want to see. And the parent container position itself has to be adjusted where you want to see it.

There is no other way than that. But then you WILL see what you want to see and only that. It only does not look good if you let the parent become even larger than it needs to be and show more of the inside then you want to show. In your screenshots the parent container is far too small, you clip the inside, you see less than you want. You neither can expect this to automatically resize nor can you expect this to adapt per row because your parent container is a child of a grid cell. And there is only one real grid row, all the others are painted with the grid recordsource row of data.

So, not only containers are containers in the sense of a box defining position and size of a rectangle also pageframes are, grids are, grid columns are and grid cells are a container, the latter resulting from the width of a grid column and the grid row height.

But how many times do we need to tell you, that you CAN'T let something inside a container stick outside of its borders? That's impossible.

Do you really still need an explanation of why your form looks the way it looks? Your texts are cut off because that's where the right border of a container is. Just because you didn't give color to the container border, that doesn't mean more text can break out and show outside of the container rectangle. right of it.

In comparison to the self-adjusting resizing world of HTML divs and other HTML objects VFP containers don't use any dynamic behavior. Their position and size is as you set it.

If you have a container inside a container inside a grid column inside a grid inside a pageframe inside a form. That doesn't change the size of the innermost container. It only shows its inside structure as far, as that fits from its (0,0) to (width,height) rectangle. Everything not in that rectangle is clipped. The container itself is clipped by the column width, if the container in the cell in the column is wider than the column it neither makes the grid column wider nor does it stick into the next column. Same with the rows bottom line. And the grid containing this is where it is relative to the pageframe position under its tabs, and the pageframe is where it's positioned on the form.

Every container of control acting as a container defines a new (0,0) coordinate for left(top positions of inside objects. That what makes it hard to position something relative to form (0,0) left upper corner position, but it makes it easy to position everything relative to where a container is positioned and if that parent is moved, no position of inner objects has to change, it all follows the container, that's the main idea. Everything moves along, also the right and bottom borders, containers don't resize. Unless you use anchoring, which complicates everything, but only acts towards the next parent level, you don't anchor everything to the form level position, you anchor position and sizes to the borders of a container.

All in all, it's complicated enough, but it's extremely easy to predict and set up in comparison to how HTML divs behave.

Bye, Olaf.

Olaf Doschke Software Engineering
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top