DriveSoft wrote:Example for three columns: 50+30+20=100%
procedure Form1_TableGrid1_OnResize (Sender: TObject);
begin
Form1.TableGrid1.Columns[0].Width := Trunc(Form1.TableGrid1.ClientWidth * (50 / 100)); // 50%
Form1.TableGrid1.Columns[1].Width := Trunc(Form1.TableGrid1.ClientWidth * (30 / 100)); // 30%
Form1.TableGrid1.Columns[2].Width := Trunc(Form1.TableGrid1.ClientWidth * (20 / 100)); // 20%
end;
For some reason, after implementing this script (which works fine) I have another problem. On my main form (frmHome) I have button1 to show Form1 with TableGrid1 (form and grid in script). When I click button1, frmHome minimizes and it's impossiblle to restore it. I tried to solve problem adding script:
procedureForm1_OnClose (Sender: String; Action: string);
begin
frmHome.Show;
end;
but after closing Form1, frmHome is still minimized and can't be restored.
Sorry for so many questions, I'm still learning and thanks for helping me.