Splitter settings
- cogier
- Site Admin
- Posts: 1127
- Joined: Wednesday 21st September 2016 2:22pm
- Location: Guernsey, Channel Islands
Splitter settings
Does anybody know what Splitter.Settings do? It has to be an integer array, but that's all I can work out.
Re: Splitter settings
I think it just holds the same splitter data as .Layout
For example, have a play with this:-
Public Sub Form_Open()
Dim iArray As Integer[]
HSplit1.Layout = [50, 50]
' iArray = HSplit1.Layout
iArray = HSplit1.Settings
Me.Text = iArray[0] & "," & iArray[1]
End
- cogier
- Site Admin
- Posts: 1127
- Joined: Wednesday 21st September 2016 2:22pm
- Location: Guernsey, Channel Islands
Re: Splitter settings
Thanks Steve, but it does not work. The iArray remains empty with either a Splitter or the deprecated HSplit.
- Quincunxian
- Posts: 173
- Joined: Sunday 25th June 2017 12:14am
- Location: Western Australia
Re: Splitter settings
The Layout parameter is used as a percentage so:
Splitter1.Layout[20,80] will give the two child controls the available space based on a percentage calculation.
The Splitter1.Settings[0] will equal the actual size of the first child control width being used.
Note# I'm using the old HSplit control ( had not noticed that it had been depreciated.)
Splitter1.Layout[20,80] will give the two child controls the available space based on a percentage calculation.
The Splitter1.Settings[0] will equal the actual size of the first child control width being used.
Note# I'm using the old HSplit control ( had not noticed that it had been depreciated.)
Hsp_Main.Height = Me.Height
Hsp_Main.Width = Me.Width
Hsp_Main.Layout = [16, 84]
Message(Hsp_Main.Settings[0] & " " & Hsp_Main.Settings[1]) '<---<<< this gives the actual size of the controls- the widths in this case.
I'm assuming that if you set the split orientation to vertical, then the settings parameter would give the height of the controls.Cheers - Quin.
I code therefore I am
I code therefore I am
- cogier
- Site Admin
- Posts: 1127
- Joined: Wednesday 21st September 2016 2:22pm
- Location: Guernsey, Channel Islands
Re: Splitter settings
Thanks guys, you are correct, the .Layout and .Settings are the same. I had to put controls in the splitter to get the values.
For anybody who's interested, here is a little program that shows this.
EDIT: - Help pages now updated.
For anybody who's interested, here is a little program that shows this.
EDIT: - Help pages now updated.
- BruceSteers
- Posts: 1579
- Joined: Thursday 23rd July 2020 5:20pm
- Location: Isle of Wight
- Contact:
Re: Splitter settings
any .Settings property of a control is for use with Settings.Write() and Settings.Read()
See here http://gambaswiki.org/wiki/comp/gb.sett ... ings/write where it explains...
"This method can handle Window objects, or any control having a Settings property."
So you can use the command...
Settings.Write(Splitter1) on form close and
Settings.Read(Splitter1) on form load
See here http://gambaswiki.org/wiki/comp/gb.sett ... ings/write where it explains...
"This method can handle Window objects, or any control having a Settings property."
So you can use the command...
Settings.Write(Splitter1) on form close and
Settings.Read(Splitter1) on form load
If at first you don't succeed , try doing something differently.
BruceS
BruceS