Author Topic: Using EZ_SETONLAYER with a Page Form  (Read 375 times)

Frank Kelley

  • Newbie
  • *
  • Posts: 5
    • View Profile
Using EZ_SETONLAYER with a Page Form
« on: August 13, 2024, 08:34:55 pm »
I have a page form with a tab control embedded in a parent window. The parent window also has a tab control. It appears the page form is being created on Layer 0, as it is visible on each of the parent's tabs. Is there a way to place the page form on layer 1, so it does not appear on any of the parent's other tabs?

I explored using EZ_SetOnLayer, getting the page form's EZ_Handle and then using EZ_AssignID, but that didn't work. Also tried using EZ_SetLayer in the page form's %EZ_Loading event...no dice there, either.

Any ideas?

Chris Boss

  • Administrator
  • Jr. Member
  • *****
  • Posts: 60
    • View Profile
Re: Using EZ_SETONLAYER with a Page Form
« Reply #1 on: August 13, 2024, 09:29:57 pm »
A lot may depend upon when you create the page form.

I find it best to add the page forms during the parent forms %EZ_Loaded event. EZGUI does not like shifting between forms control creation mid stream.

Also it may be difficult to put the page form itself on the parent forms layers.

I really didn't do a lot of testing with layers on page forms as well as the parent form at the same time. There may be issues.

My suggest is simply to experiment with different ways of handling things. You may find one that works for your situation.

Now one technique which may work better is to convert your page form into a a Component (see: EZ_DefComponent command).

Components are forms which have controls on them which are treated as it is a single control. A component can even be used multiple times on the same parent form.

Since a Component is treated as if it was a single control it may work better with Layers.


Frank Kelley

  • Newbie
  • *
  • Posts: 5
    • View Profile
Re: Using EZ_SETONLAYER with a Page Form
« Reply #2 on: August 14, 2024, 05:57:45 am »
After a night's sleep, I came at the problem differently. Ignoring the layer question entirely, I created a second, tiny page form (7 x 1) and loaded it immediately after the first page form in the parent's EZ_Loaded event. This second page form is positioned over a blank space on the parent, so while it's present, you can't see it. I can then use EZ_ShowPage in the parent's tab events to show the first page form when layer 1 is selected, and switch to the blank second page form when other layers are selected on the parent form.

This took only about five minutes to put into place and it works perfectly!