Re: TSplitter Persistence problem



samjones wrote:
Delphi returns this same sequence when the controls are positioned properly or with the problem positioning. Therefore I assume Delphi does not use the Controls array sequence to define the controls position in a container. In C#, Controls determines the position in the container and Controls.SetIndex
(Splitter1,1) would move Splitter1 to the second position in the container.

Are you using .Net? If you are, you should say so. Otherwise, most of us will assume you're using Win32. If you're using .Net, then the Controls property should work the same as it does in C# because C# and Delphi both get the property from the .Net Framework's class library. At least, a Delphi WinForms program should have the same behavior. A Delphi VCL program might have its own Controls array implemented the same as it is in the Win32 version of the VCL.


So how does Delphi determine the position of a control in a container?

By the order in which they are added to that container. When you drop controls on your form, descendants of TGraphicControl are placed ahead of descendants of TWinControl. There is a good reason for that. I can't think of what it is right now, though. Probably something to do with Z-ordering and a lack of window handles.


And more importantly how do we manipulate it?

Create the controls in a different order.

--
Rob
.



Relevant Pages

  • Re: Definition of outdated...
    ... There are often a reference to a programming language to be 'outdated', ... Looking strictly at the wording, then Java is more outdated than Delphi, ... What imo should be outdated is how money controls hype that controls ...
    (borland.public.delphi.non-technical)
  • Re: Converting a userspecific VCL-component to an ActiveX-control
    ... > the controls are in OCXes - not a good idea IMO ... the only control it does recognize is a TPanel (not the hWnd of ... making the native VCL interface available as ActiveX interface? ... I think with a fairly up to date version of Delphi (lets say at least ...
    (comp.lang.pascal.delphi.misc)
  • Re: Delphi Dot Net, Better than Win32, or just Hype?
    ... > Basically it's offering Visual Studio developers to give tham what Delphi ... His reaction; ... After demonstrating bound db controls and the dynamics and freedom of this ... about how stupid it was to use bound controls. ...
    (borland.public.delphi.non-technical)
  • Re: need proof???
    ... is 4 with Indy Internet replacing the Internet rubbish in 4 ... controls unless one is desperate, for example in Delphi I use THTML ... Obviously the out house programming team is not exactly up to scratch, ...
    (microsoft.public.vb.general.discussion)
  • Re: Delphi to C#?
    ... WinForms allows binding of controls directly to properties of objects, something that Delphi cannot yet cope with; in fact, .NET allows controls to be the datasource for other controls. ... There is a whole different design ethic behind .NET compared to Win32; most importantly that *everything* in .NEt is essentially an object whereas in Delphi for Win32 methods it is not yet possible to have every type assignable to a common type of variable/field like System.Object, thus providing useful common methods like ToString. ...
    (borland.public.delphi.non-technical)