Recent

Author Topic: [Solved] stringGrid in a TFrame, how store columns width?  (Read 975 times)

BlueIcaro

  • Hero Member
  • *****
  • Posts: 827
    • Blog personal
[Solved] stringGrid in a TFrame, how store columns width?
« on: March 07, 2022, 10:26:50 am »
Hi, I started to work with TFrame. I put a TStringGrid on a TFrame, and works nice. But I would like store the width of cols, and other properties of stringGrid.
Before use TFrame, I put the stringGrid in a TForm and I used TXMLPropStorage with Sesion Properties.
But TFrame hasn't Sesion properties.

is there a way to use TXMLPropStorage (or some thing equivalent )with TFrame as used TForm?. Or I have to hard code some procedures to store the properties?.

Thanks

/BlueIcaro
« Last Edit: March 08, 2022, 02:17:55 pm by BlueIcaro »

BlueIcaro

  • Hero Member
  • *****
  • Posts: 827
    • Blog personal
Re: stringGrid in a TFrame, how store columns width?
« Reply #1 on: March 08, 2022, 02:17:32 pm »
Hi, I found that TStringGrid has a save method to do it

Code: [Select]

    Grid.SaveOptions := [soDesign];
    Grid.SaveToFile('Name');


To restore can be used:
Code: [Select]

    GridEntradasSistema.SaveOptions := [soDesign];
    GridEntradasSistema.LoadFromFile(Self.Name); 

/BlueIcaro

MarkMLl

  • Hero Member
  • *****
  • Posts: 8515
Re: [Solved] stringGrid in a TFrame, how store columns width?
« Reply #2 on: March 08, 2022, 02:20:44 pm »
Note that any design-time properties must be applied directly to the original frame, not to an instance which has been placed on a form.

If you edit a frame in a form, the settings do not get transmitted back to the original definition and you are (very) likely to have to edit the .lfm to get rid of them.

MarkMLl
MT+86 & Turbo Pascal v1 on CCP/M-86, multitasking with LAN & graphics in 128Kb.
Logitech, TopSpeed & FTL Modula-2 on bare metal (Z80, '286 protected mode).
Pet hate: people who boast about the size and sophistication of their computer.
GitHub repositories: https://github.com/MarkMLl?tab=repositories

 

TinyPortal © 2005-2018