Board index » delphi » Saving and Restoring TCoolbar bands positions
Daniel Terhell
![]() Delphi Developer |
Mon, 15 Jul 2002 03:00:00 GMT
Saving and Restoring TCoolbar bands positions
Here's a way how to save & restore TCoolbar bands positions in Delphi5.
Saving Positions: Of each band in the coolbar, write the name of the control it owns, the procedure WriteCoolbarState(item: TCoolBar); SaveStringSomewhere(item.Name+'Control'+intToStr(r),item.Bands[r].Control.N SaveBooleanSomewhere(item.Name+'Break'+intToStr(r),item.Bands[r].Break); SaveIntegerSomewhere(item.Name+'ControlWidth'+intToStr(r),item.Bands[r].Con SaveIntegerSomewhere(item.Name+'Width'+intToStr(r),item.Bands[r].Width); Restoring Positions: Of all bands in the the coolbar, read first back the Index properties. Now procedure ReadCoolbarState(item: TCoolBar); item.Bands.BeginUpdate; for r:=0 to item.Bands.Count-1 do for r:=0 to item.Bands.Count-1 do item.Bands.EndUpdate; Now you still need to provide your own SaveDataSomewhere and ReadDataBack function ReadStringBack(identifier: String; var rst: String): Boolean; function SaveStringSomewhere(identifier: String;val: String): Boolean; Greetings, Daniel Terhell |