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

ADDING GRIDS AND CONTAINER ON TOP OF AN IMAGE

Status
Not open for further replies.

maxineon

MIS
Dec 22, 2016
2
0
0
US
Hi ALL,
I have form that i filled with an image, then i dropped there a grid and container with some txtboxes, i am wondering how can i make the grid and the container to show on top as it is not happening, when i run the form i am not able to see those objects, i don't even find a property to bring the at front
thanks a lot
 
This is something you can fix at design time.

Open the form in the form designer. Click on the image, then go to the Format menu, and select Send to Back.

If you add further objects later, you might need to repeat the process.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips and downloads
 
The native VFP Image control will be in background. Controls you add later always are on top, so what did you use for the image?
I assume you used an ActiveX control for image display. Why? Is it a picture format the VFP Image control does not support?

Edit:
To state the (not so) obvious: ActiveX controls are by definition forms themselves, so it's difficult to put a VFP control in front of an ActiveX control. That besides the normal image control not having a z-order problem I also assume you must be using an ActiveX control for image display, maybe even the olebund control bound to a general field?

Bye, Olaf.
 
Hi Mike, OlafDoschke
I just created an image with Corel draw jpg file, something i just designed and realized that when putting on top of the form to fill the form with it, then later when adding the controls or whatever on top, at run time and even design time i could not see them, now after adding in the image init property "This.zorder(1)" when running the form, then all controls, labels and grid are on top of the image.

Thanks as always for fast and dedicated responses to the one who know less abd by the way i want to wish you and your families a great Holidays and a Happy new year
Thanks
Ernesto
 
Hm, strange. If you add an image to an empty form then it will remain at the back of everything. What you add later always goes on top by itself, no code necessary to do that.

If you put an image control on a form after having designed it, you have to push it back as Mike suggested via the menu "Format"->"Send to Back". Or use the Form.Picture property for a background picture. That will be simplest for that matter.

Bye, Olaf.
 
Yes, as Olaf says, it seems a bit strange. If you placed the Image on the form before the other controls, then the other controls would normally appear on top of the Imager.

But if you have now got it working satisfactorily, that's fine.

By the way, Ernesto, I see that you have logged into the forum under a new name. Is there any special reason for that? I'm only asking out of curiosity. Don't answer if you prefer not to.

Mike



__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips and downloads
 
Hi Mike and Olaf,
Yes i needed to a new username and different email cause i could not remember my old password and i was trying to recover or change the password and i could not do it, decided then to create a new account, sorry if this it is an inconvenient for you but did not have another choice.

If you put an image control on a form after having designed it, you have to push it back as Mike suggested via the menu "Format"->"Send to Back". Or use the Form.Picture property for a background picture. That will be simplest for that matter.

That was the problem, that i never "sent it back", so when i was dropping other objects, then they were going back or underneath the image, until i googled and found that adding the
"This.zorder(1)" "in the init property of the image", allow me to send it back, don't know why i got so complicated, when i have on hands the command from the menu, to "send it back "
but i am a little complicated person, so sometimes easy thing, becomes difficult for me, anyway it is always a such a great thing to have you guys here.
Best Rgds
Ernesto
 
>That was the problem, that i never "sent it back", so when i was dropping other objects, then they were going back or underneath the image

This doesn't happen. Every control/object you put on a form later will be in front. But if you want something, i.e. the image control, to instead appear behind anything already on the form, you have to send it back.

So it really isn't understandable what happened to you. What you describe doesn't happen on its own.

Bye, Olaf.
 
Take a look at the baseclass of the control you really put on your form. You should use the VFP native image control, not the ole or olebound control, these are ActiveX containers having the problem I initially described:

myself said:
ActiveX controls are by definition forms themselves, so it's difficult to put a VFP control in front of an ActiveX control.

Yes, gdiplus is a way to also draw images directly onto the form canvas or even as grid background, bernard bout has more ways of applying a nicer look to applications, but you need nothing more than a normal image control for a general background and there is nothing special about its z-order. Alternatively you use the form.picture property, which is in the background by definition. That's two separate solutions.

Bye, Olaf.
 
Olaf,
After i sent back the image on the form(after you guys told me), then now any object i put there appears on top of the image, like i said cause i never sent the image back before and cause i thou that i need to find a property on the image where i can send it back but never found it on the properties of the image, i did not know(believe or not) that i could get from the Visual foxpro menu, the option to "send it back', so that was the reason of googling for why my image was not going back and selected the choice of adding the "This.zorder(1) in the image init property.
so you are correct, i never said you don't but it was me who was getting complicated as a fool, for not finding the "send back" from the VFP MENU, things like this happening to people like me for not paying attention enough.
Thanks for been there to clarify
Rgds
 
Well,

you initially said:
land_fla said:
I have form that i filled with an image, then i dropped there a grid and container with some txtboxes

and then:
land_fla said:
when i was dropping other objects, then they were going back or underneath the image

and once more:
land_fla said:
when putting on top of the form to fill the form with it, then later when adding the controls or whatever on top, at run time and even design time i could not see them

In all these three quotes you stated you put controls on the form after adding a picture. But then the controls don't disappear behind it. What you described three times in different words doesn't happen. So it's still unclear what you really did. I have the feeling you yourself don't know how you did what in which order.

Bye, Olaf.
 
Just as there's "Send to back" on the menu (and the layout toolbar) there's "Send to front". It can be really easy to click that inadvertently and not notice it until you're in a situation where you don't understand what's happening.
 
I don't know how you would get there accidentally. You'd need to type ALT, then ALT+O and ALT+F to bring a currently selected control to the front. Accidentally pressing ALT and typing the word "of" might be possible, but then you also had to have selected the image control at that time. When do you design forms and type text at the same time? Not before switching to the code editor or property window.

Anyway, it'll get apparent the moment you do so and you can revert such actions with CTRL+Z (Undo), no change you do in a designer is saved right away.

Bye, Olaf.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top