PlanetSquires Forums

Support Forums => Other Software and Code => Topic started by: Richard Marchessault on February 07, 2013, 02:12:00 PM

Title: Layered Controls
Post by: Richard Marchessault on February 07, 2013, 02:12:00 PM
I have a form where some controls are layered over a picture and other controls overlap controls at some points. When I layout the form I can move controls forward or backward to layer them correctly. They display fine in the design and when the application is compiled and run. The problem occurs when the project is next loaded into a new Firefly session. The layering that was setup with the design in the previous Firefly session is lost. Although the application will display properly when compiled and run, the layering that was established in the design is not what is displayed. I can manually change the layers so the design displays correctly both in the design as well as the executing application but what can be done to maintain the layering so that it will be correct each time the project is loaded into Firefly?

Is this a problem that we have no ready solution for?
Title: Re: Layered Controls
Post by: Richard Marchessault on February 10, 2013, 05:46:35 PM
I don't have a solution for the layering at design time. However, for run time, what seems to work is to put the controls that are farthest in the background at the bottom of the tab order and the controls that are the farthest forward at the top of the tab order. Putting the overlapping controls in the right tab order seems to assure that they are properly displayed.
Title: Re: Layered Controls
Post by: Wilko Verweij on February 11, 2013, 09:23:54 AM
You could use BringWindowToTop or SetWindowPos (see http://msdn.microsoft.com/en-us/library/aa922057.aspx (http://msdn.microsoft.com/en-us/library/aa922057.aspx)).
That should always work at run-time.
Wilko
Title: Re: Layered Controls
Post by: Richard Marchessault on February 11, 2013, 09:57:34 AM
I saw that but since I am dealing with controls and not windows, I wondered if this was applicable.
Title: Re: Layered Controls
Post by: Wilko Verweij on February 11, 2013, 11:15:57 AM
If it has a window handle you can apply these functions AFAIK....

Wilko