Recent

Author Topic: TFrame problem  (Read 5174 times)

ensimek

  • Jr. Member
  • **
  • Posts: 55
TFrame problem
« on: March 12, 2011, 10:12:38 pm »
Hi guys

I would like You to ask if there's any way to change loaded Frame - for example:

On Form1 there is a TFrame component with Frame1 loaded, can I somehow place Frame2 in the same TFrame (Frame2 instead of Frame1)

Thanks a lot,
Luke

ensimek

  • Jr. Member
  • **
  • Posts: 55
Re: TFrame problem
« Reply #1 on: March 12, 2011, 11:03:57 pm »
I figured out that I can place Frame2_1 with another frame docked while Frame1_1.visible is set to False and the other to True.

But the next problem is that at Frame2_1 I have Button with:
Frame2_1.visible:=False;
Frame1_1.visible:=True;

I expect to see Frame1_1 but nothing changes while clicking....

ensimek

  • Jr. Member
  • **
  • Posts: 55
Re: TFrame problem
« Reply #2 on: March 13, 2011, 08:29:15 am »
all above solved.

I've a strange feeling that Frames are quite not working in Lazarus :/.

Now there's IBConnection1, SQLQuery1, SQLTransaction1, DataSource1, TDBGrid1 at Frame2_1.

There's a button at Form2 which does:
Code: [Select]
Frame1_1.Visible:=False;
  Frame2_1.IBConnection1.Connected:=True;
  if Frame2_1.IBConnection1.Connected then
     begin
       Frame2_1.SQLTransaction1.Active:=True;
       Frame2_1.SQLQuery1.SQL.Text:='SELECT * FROM klienci';
       Frame2_1.SQLQuery1.Active:=True;
       Frame2_1.SQLQuery1.Open;
       Frame2_1.Align:=alClient;
       Frame2_1.Visible:=True;
       Frame2_1.SQLTransaction1.Active:=False;
     end;
  Frame2_1.SQLTransaction1.Active:=False;

Guess what? DBGrid somehow stays empty, but if I do the same in Lazarus setting all to Active DBGrid Fills with data :/

eny

  • Hero Member
  • *****
  • Posts: 1658
Re: TFrame problem
« Reply #3 on: March 13, 2011, 12:43:01 pm »
Frame's seem to work if you don't touch them after having being droppen on a form.
If changes are made to a frame, all instances of that frame have to be deleted and re-dropped on the parent form to prevent problems.
All posts based on: Win11; Lazarus 4_4  (x64) 12-02-2026 (unless specified otherwise...)

ensimek

  • Jr. Member
  • **
  • Posts: 55
Re: TFrame problem
« Reply #4 on: March 13, 2011, 03:31:53 pm »
But what about not showing records in dbgrid?

 

TinyPortal © 2005-2018