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!

Do Form BLAH within specific tab of a page frame?

Status
Not open for further replies.

dantheinfoman

Programmer
May 5, 2015
131
US
Hi All,

I'm not finding anything decent on google, trying to discover how to make a form appear in a specific tab of another form. I have the main screen, then I want a popup form with tabs and as new dashboard item forms are initialized, I'd like them to appear in the appropriate tabs, depending on their topic.

Any ideas are appreciated.

Thanks

Dan
 
You cannot have a form popup within a page of a pageframe. but you can set the position of the form over the page. pass the page location to the form as parameters (top, left, width, height) and set these in the Init() event of the popup form. The popup form is relative to the screen and not the page so you have to account for the position. If the underlying form is moved, the popup will not be moved. I would recommend making the popup form borderless to prevent movement of it (unless you want it moved). but if the user selects the underlying form, the popup will move to the back unless you make it always-on-top. When you call the popup you can use the NAME parameter to get a handle to the form. Store this value in a custom property of the base form and then if it is moved, you can reposition the popup form in the Resize() event to keep it aligned in the page.
 
If you have forms you want to show as pageframes, then you may make use of docking, though that means no pageframe form and no real pageframe.

A second idea is, to design pages that are equivalent to your forms.

And a more generally working idea is to put UI into a container base class you can either put into a pageframe or form at runtime.

Just think about the main idea of todays development to not do anything twice.

Bye, Olaf.
 
You can't place a form in a tab of another form. A "tab" (I assume you mean a page within a pageframe) can hold textboxes, labels, and most other types of controls. But it can't hold a form. The only thing that can contain a form is a formset, and I doubt that's what you want.

Also, what do you mean by a "popup" form?

If you could explain more clearly what you are trying to achieve, I'm sure we can give you the answer.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips and downloads
 
Hi Guys,

Thank you for replies thus far, very informative.

More specifically, I have a small form whose Init parameters determine what FoxyCharts will create for a dashboard chart/graph and what table it will use, etc. I have a page frame with multiple pages, such as Payroll, Schedules, Misc Dashboards, etc. Each pageframe has the potential of having up to 8 dashboard items = charts. It sounds like rather than saying DO Form Dashboard with x, y, z, and it going into a particular tab (page), it sounds like I need to put a bunch of empty charts in some kind of container and for it to loop through those in order to populate. And if the user only wanted 3 of the 8 dashboards turned on, then the rest in the loop would simply go invisible.

I don't know how to make a container class, but I will look into this step immediately.

Thanks

Dan
 
Open one of the forms you'd like to show in a pageframe in the form designer.
Select all controls in it (CTRL+A).
Now in the Menu File->Save As Class, give a name and a vcx file (you can also simply specify a name and it'll be created as vcx), eg pf1 in pfs.vcx

You'll have a pfs.vcx (pfs as short for pageframes) with a class pf1 (pageframe1).

Now you can do several things, eg in your form with the empty tabs pageframe you can drag the pf1 into a page.

You can now use this pf1 class anywhere you want, you can modify it seperately and wherever you dragged it it's also updated.

Bye, Olaf.



 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top