Paul, have you tried setting the Top position before setting the Align property? When the Align is set, something has to be pushed out of the way, so to speak, and which way it goes depends on where the object being aligned is currently sitting. I'd try setting Top to be Top + Height of the previous item.
Jeremy -----Original Message----- From: advanced_delphi@yahoogroups.com on behalf of Paul Bennett Sent: Tue 3/4/2008 1:14 AM To: advanced_delphi@yahoogroups.com Subject: Re: [advanced_delphi] Re: Display orderof dynamically created frames. The target form is a Data Input form, and therefore would not suit a Wizard. The form is the view part of a MVC pattern, each of the Frames is declared in the private area of the form, and are created as required by the Controller. The order of creation is the same as the required order of presentation. If a particular frame is not required for the object currently being edited then it is not created. The problem that I have is that, although the frames are created in the required order they aren't displayed in the same order! Below is a code snippet which should create each of the Frames fModel.CurrentFrame.RedrawGraphic(fView.imgFrameImage, 3); // Qty, Height, Width, colour and Cills - Always displayed fView.HeaderEdit := THeaderEdits.Create(fView.sbEditor); fView.HeaderEdit.InitializeNewFrame(...) .... fView.HeaderEdit.Parent := fView.sbEditor; fView.HeaderEdit.Align := alTop; // Main Mullions Frame fView.MainMullion := TMainMullion.Create(fView.sbEditor); fView.MainMullion.Parent := fView.sbEditor; fView.MainMullion.Align := alTop; // Mullion Edits fView.MullionEdits := TMullionEdits.Create(fView.sbEditor); fView.MullionEdits.Parent := fView.sbEditor; fView.MullionEdits.Align := alTop; // Transom edits fView.TransomEdits := TTransomEdits.Create(fView.sbEditor); fView.TransomEdits.Parent := fView.sbEditor; fView.TransomEdits.Align := alTop; // Outer Frame Profile - Always Displayed fView.OuterFrame := TOuterProfile.Create(fView.sbEditor); fView.OuterFrame.Parent := fView.sbEditor; fView.OuterFrame.Align := alTop; fView.OuterFrame.InitializeNewFrame(...); fView.OuterFrame.Align := alTop; // Door Sash fView.DoorSash := TDoorSash.Create(fView.sbEditor); fView.DoorSash.Parent := fView.sbEditor; fView.DoorSash.Align := alTop; // Glass Selection Editor - Always Displayed fView.GlassEdits := TGlassEdits.Create(fView.sbEditor); fView.GlassEdits.InitializeNewFrame(...); fView.GlassEdits.Parent := fView.sbEditor; fView.GlassEdits.Align := alTop; // Handle edits fView.HandleEdit := THandleEdit.Create(fView.sbEditor); fView.HandleEdit.Parent := fView.sbEditor; fView.HandleEdit.Align := alTop; // Footer Section Editor - Always Displayed fView.FooterEdits := TFooterEdits.Create(fView.sbEditor); fView.FooterEdits.Parent := fView.sbEditor; fView.FooterEdits.Align := alClient; fView.MainPage.Visible := True; fView.MainPage.ActivePageIndex := 2; fView.HeaderEdit.txtQty.SetFocus; When run the display order is 1. HandleEdit (8) 2. GlassEdits (7) 3. DoorSash (6) 4. HeaderEdit (1) 5. MainMullion (2) 6. MullionEdits (3) 7. TransomEdits (4) 8. OuterFrame (5) 9. FooterEdits (9) (numbers in brackets is the position it should have been displayed at). Paul. As I said in my original post, I have used frames because the controls on the form tend to be naturally grouped > ----- Original Message ----- > From: "David Smith" <[EMAIL PROTECTED]> > To: advanced_delphi@yahoogroups.com > Subject: Re: [advanced_delphi] Re: Display orderof dynamically created frames. > Date: Fri, 29 Feb 2008 07:08:27 -0800 (PST) > > > Okay, sounds like you're form may be better off as a wizard? > LMD has a nice free wizard component that helps manage complexities > like that. > > You haven't really explained whether you are trying to > instantiate all frames at once or not. If yes, I would say to rem > out each one and re-enable one by one, so you can see what drawing > problems are arising to change things from your expectation. > > Dave Experience is something you don't get until just after you need it. -- _______________________________________________ Surf the Web in a faster, safer and easier way: Download Opera 9 at http://www.opera.com Powered by Outblaze
<<winmail.dat>>