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

Page Caption: any way to put in an image?

Status
Not open for further replies.

CEMrob

Programmer
Sep 2, 2008
24
GB
VFP 9.0
You can add a picture to a menu option. Is there a way to add a picture to the caption of a page on a pageframe?

I've searched the forum & FAQs & can't see anything, but apologies if this has already been addressed.

Thanks.
 
Unfortunately, this is not possible (I wish it was).

However, there is a workaround. Essentially, you can create your own tabs, as follows:

- Hide the existing tabs (by setting the Tabs property to .F.)

- Create another control to serve in place of the tabs. The best control to use is an option group whose style has been set to "graphical", but you could also use a set of command buttons or labels. Place this control on the form.

- In this alternative control, set the captions to match those of the pages, and set the Picture property to point to the images that you want to use.

- In the Click event (or the InteractiveChange, if appropriate), fire off some code to change the ActivePage property of the pageframe.

If you experiment a bit with the cosmetics, you should get a pleasing effect.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips, training, consultancy
 
There is a picture property of a page, indeed. It's new in 9, too.

Bye, Olaf.
 
Oops, sorry. That page.picture property is for the whoe page, not for the tab.

I wonder, though, as I remember there should be an icon possible per page, as the tab color is not changable anymore with themes activated, so that was suggested as an alternative in some posts, not (only) by me.

Bye, Olaf.
 
There is a picture property of a page, indeed. It's new in 9, too.

Actually, Olaf, I think the Picture property for the page has always been there. I've been showing it to trainees on my courses for a long time now.

But, as you say, it's no help for CEMRob, as it applies to the page as a whole rather than the tab.

Mike


__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips, training, consultancy
 
Yes, that's of course not new. Also the page.picture is not drawn on the tab portion of a page. I'm confusing this with something else.

Bye, Olaf.

 
Thanks Mike, I should have remembered that some years ago I did a small App for someone and had fun using pageframes with no tabs but using other controls to switch between pages. I think I also mimicked an early 'wizard' type form, where the user stepped through (and back) a sequence of queries on different (untabbed) pages.

I suppose I could also put a set of picture controls along the top (or side) edge of the pageframe if I really wanted copy the look of Tab captions.

It was just a whim really, and I had in my minds eye a caption with both text and an illustrative picture - as you can with menu options or command buttons.

Olaf, how can you have an icon per page, or have I misunderstood you?

 
CEMRob,

Yes, I agree about the wizard forms. I regularly create wizards that are based on tab-less pageframes, with the Next and Back buttons controlling the active page.

I'd enourage you to experiment with a graphical option group. As well as letting you show both images and text, it has the advantage that one "tab" (that is, one button) is always "down" (if you see what I mean).

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips, training, consultancy
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top