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?
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.
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
I saw that but since I am dealing with controls and not windows, I wondered if this was applicable.
If it has a window handle you can apply these functions AFAIK....
Wilko