Why is this not working (frames) ???

Two panels on a form.On panel1 two buttons-panel2 is for showing frames:
The code:

unit Unit1;
interface
uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, ExtCtrls, dxsbar, dxGDIPlusClasses, ImgList, StdCtrls;
type
TFrames = (Frame2, Frame3);
    TForm1 = class(TForm)
    Panel1: TPanel;
    Panel2: TPanel;
    Button1: TButton;
    Button2: TButton;
    procedure FormCreate(Sender: TObject);
    procedure FormDestroy(Sender: TObject);
    procedure Button1Click(Sender: TObject);
    procedure Button2Click(Sender: TObject);
  private
  Frame2, Frame3 : TFrame;
  fActiveFrame: TFrames;
  procedure SetActiveFrame(const Value: TFrames);
  { Private declarations }
  public
  property ActiveFrame : TFrames read fActiveFrame write SetActiveFrame;
 { Public declarations }
  end;
var
  Form1: TForm1;
implementation
{$R *.dfm}
Uses Unit2,Unit3;
procedure TForm1.SetActiveFrame(const Value: TFrames);
var
  LastFrame : TFrames;
 begin
  if fActiveFrame <> Value then
    begin
      LastFrame := fActiveFrame;
      fActiveFrame := Value;
            case LastFrame of
        Frame2 : Frame2.Parent := nil;
        Frame3 : Frame3.Parent := nil;
      end;
      case fActiveFrame of
        Frame2 : Frame2.Parent := Panel2;
        Frame3 : Frame3.Parent := Panel2;
      end;
    end;
    end;
procedure TForm1.FormCreate(Sender: TObject);
begin
Frame2 := TFrame.Create(nil);
Frame3 := TFrame.Create(nil);
end;
procedure TForm1.FormDestroy(Sender: TObject);
begin
FreeAndNil(Frame2);
FreeAndNil(Frame3);
end;

procedure TForm1.Button1Click(Sender: TObject);
begin
ActiveFrame := Frame2;
end;
procedure TForm1.Button2Click(Sender: TObject);
begin
ActiveFrame := Frame3;
end;
end.


I get :
[Error] Unit1.pas(51): Constant expression expected
[Error] Unit1.pas(81): Incompatible types: 'TFrames' and 'TFrame'
LVL 22
senadAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Geert GOracle dbaCommented:
try this

ps you don't need to declare TFrames

just fActiveFrame: TFrame;
unit Unit1;
interface
uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, ExtCtrls, dxsbar, dxGDIPlusClasses, ImgList, StdCtrls;
type
  TForm1 = class(TForm)
    Panel1: TPanel;
    Panel2: TPanel;
    Button1: TButton;
    Button2: TButton;
    procedure FormCreate(Sender: TObject);
    procedure FormDestroy(Sender: TObject);
    procedure Button1Click(Sender: TObject);
    procedure Button2Click(Sender: TObject);
  private
    Frame2: TFrame;
    Frame3: TFrame;
    fActiveFrame: TFrame;
    procedure SetActiveFrame(const Value: TFrame);
  public
    property ActiveFrame: TFrame read fActiveFrame write SetActiveFrame;
  end;
var
  Form1: TForm1;
implementation
{$R *.dfm}
Uses Unit2,Unit3;
procedure TForm1.SetActiveFrame(const Value: TFrame);
var
  LastFrame : TFrames;
begin
  if fActiveFrame <> Value then
  begin
    LastFrame := fActiveFrame;
    fActiveFrame := Value;
    LastFrame.Parent := nil;
    fActiveFrame.Parent := Panel2;
  end;
end;
 
procedure TForm1.FormCreate(Sender: TObject);
begin
  Frame2 := TFrame.Create(nil);
  Frame3 := TFrame.Create(nil);
end;
 
procedure TForm1.FormDestroy(Sender: TObject);
begin
  FreeAndNil(Frame2);
  FreeAndNil(Frame3);
end;
 
procedure TForm1.Button1Click(Sender: TObject);
begin
ActiveFrame := Frame2;
end;
procedure TForm1.Button2Click(Sender: TObject);
begin
ActiveFrame := Frame3;
end;
end.

Open in new window

0
mokuleCommented:
no const needed here I think
procedure SetActiveFrame(const Value: TFrame);
0
Geert GOracle dbaCommented:
that line is created automaticly by Delphi after hitting Ctrl-Shift C with class completion
0
Become a Certified Penetration Testing Engineer

This CPTE Certified Penetration Testing Engineer course covers everything you need to know about becoming a Certified Penetration Testing Engineer. Career Path: Professional roles include Ethical Hackers, Security Consultants, System Administrators, and Chief Security Officers.

Mike LittlewoodEngineerCommented:
Always wonder why delphi does that because it is strictly incorrect.
0
Geert GOracle dbaCommented:
i believe it's for the interfaces
when you pass a interface to a procedure and don't use const
the interface gets nil'ed

so they got lazey and added const to every property getter/setter
0
senadAuthor Commented:
Geert_Gruwez:
I copy&pasted your example and  compiler gave me error:
[Error] Unit1.pas(32): Undeclared identifier: 'TFrames'
[Error] Unit1.pas(38): Missing operator or semicolon
[Fatal Error] Project1.dpr(7): Could not compile used unit 'Unit1.pas'


It stopped on :
procedure TForm1.SetActiveFrame(const Value: TFrame);
var
  LastFrame : TFrames;  ..........
0
mokuleCommented:
should be
var
  LastFrame : TFrame;
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
senadAuthor Commented:
Mokule
I got a nasty crash (debugger notification) on compiling this one.
 It died on :
 LastFrame.Parent := nil;

The code:
unit Unit1;
interface
uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, ExtCtrls, dxsbar, dxGDIPlusClasses, ImgList, StdCtrls;
type
  TForm1 = class(TForm)
    Panel1: TPanel;
    Panel2: TPanel;
    Button1: TButton;
    Button2: TButton;
    procedure FormCreate(Sender: TObject);
    procedure FormDestroy(Sender: TObject);
    procedure Button1Click(Sender: TObject);
    procedure Button2Click(Sender: TObject);
  private
    Frame2: TFrame;
    Frame3: TFrame;
    fActiveFrame: TFrame;
    procedure SetActiveFrame(const Value: TFrame);
  public
    property ActiveFrame: TFrame read fActiveFrame write SetActiveFrame;
  end;
var
  Form1: TForm1;
implementation
{$R *.dfm}

Uses Unit2,Unit3;

procedure TForm1.SetActiveFrame(const Value: TFrame);
var
  LastFrame : TFrame;
begin
  if fActiveFrame <> Value then
  begin
    LastFrame := fActiveFrame;
    fActiveFrame := Value;
    LastFrame.Parent := nil;
    fActiveFrame.Parent := Panel2;
  end;
end;
 
procedure TForm1.FormCreate(Sender: TObject);
begin
  Frame2 := TFrame.Create(nil);
  Frame3 := TFrame.Create(nil);
end;
 
procedure TForm1.FormDestroy(Sender: TObject);
begin
  FreeAndNil(Frame2);
  FreeAndNil(Frame3);
end;
 
procedure TForm1.Button1Click(Sender: TObject);
begin
ActiveFrame := Frame2;
end;
procedure TForm1.Button2Click(Sender: TObject);
begin
ActiveFrame := Frame3;
end;
end.
0
Geert GOracle dbaCommented:
procedure TForm1.SetActiveFrame(const Value: TFrame);
var
  LastFrame : TFrame;
begin
  if fActiveFrame <> Value then
  begin
    LastFrame := fActiveFrame;
    fActiveFrame := Value;
    if LastFrame <> nil then
      LastFrame.Parent := nil;
    fActiveFrame.Parent := Panel2;
  end;
end;
0
Geert GOracle dbaCommented:
probably this too:

procedure TForm1.SetActiveFrame(const Value: TFrame);
var
  LastFrame : TFrame;
begin
  if fActiveFrame <> Value then
  begin
    LastFrame := fActiveFrame;
    fActiveFrame := Value;
    if LastFrame <> nil then
      LastFrame.Parent := nil;
    if fActiveFrame <> nil then
      fActiveFrame.Parent := Panel2;
  end;
end;
0
Geert GOracle dbaCommented:
this is the same behaviour you want as ActiveControl
the form which has focus is in ActiveControl
0
senadAuthor Commented:
Frames not showing !?
0
Geert GOracle dbaCommented:
Frames not showing ?!

would you care to explain ?
somehow there are some more lines missing with more clarification as what you mean :)
0
senadAuthor Commented:
Clicking on the either button does not display the frame.
If I click button one ,there should be Frame2 showing on Panel2.
If I click button two ,there should be Frame3 showing on Panel2.
It does not do anything now :-)


0
Geert GOracle dbaCommented:
what about not checking for
fActiveFrame <> Value

procedure TForm1.SetActiveFrame(const Value: TFrame);
var
  LastFrame : TFrame;
begin
  LastFrame := fActiveFrame;
  fActiveFrame := Value;
  if LastFrame <> nil then
    LastFrame.Parent := nil;
  if fActiveFrame <> nil then
    fActiveFrame.Parent := Panel2;
end;
0
Geert GOracle dbaCommented:
and why not

procedure TForm1.FormCreate(Sender: TObject);
begin
  Frame2 := TFrame.Create(Self);
  Frame3 := TFrame.Create(Self);
end;
0
Geert GOracle dbaCommented:
the you can delete

procedure TForm1.FormDestroy(Sender: TObject);
begin
  FreeAndNil(Frame2);
  FreeAndNil(Frame3);
end;
0
senadAuthor Commented:
Did you try and compile this?
Please try and let me know if it works for you...
To me it does not.
0
Geert GOracle dbaCommented:
I typed this in the browser
never opened Delphi to create this

i'll do it now :D

0
Geert GOracle dbaCommented:
I recreated an example of this myself

started from scratch
the result is in the snippet :

the differences you still need for your code
is that you are using TFrame
and none of the descendants you created in Unit2 and Unit3
you are displaying empty, clean, transparent frames !

procedure TForm1.FormCreate(Sender: TObject);
begin
  Frame2 := TFrame.Create(nil);
  Frame3 := TFrame.Create(nil);
end;

should be

procedure TForm1.FormCreate(Sender: TObject);
begin
  Frame2 := TFrame2.Create(Self);
  Frame3 := TFrame3.Create(Self);
end;

if the frames are called TFrame2 and TFrame3 off course !

I thought you were still going to adjust this
I guessed wrong

unit Unit1;
 
interface
 
uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, ExtCtrls, StdCtrls;
 
type
  TForm1 = class(TForm)
    Button1: TButton;
    Button2: TButton;
    Panel1: TPanel;
    procedure Button1Click(Sender: TObject);
    procedure Button2Click(Sender: TObject);
  private
    fActiveFrame: TFrame;
    fFrame2: TFrame;
    fFrame3: TFrame;
    function GetFrame2: TFrame;
    function GetFrame3: TFrame;
    procedure SetActiveFrame(const Value: TFrame);
  public
    constructor Create(AOwner: TComponent); override;
    property DisplayFrame2: TFrame read GetFrame2;
    property DisplayFrame3: TFrame read GetFrame3;
    property ActiveFrame: TFrame read fActiveFrame write SetActiveFrame;
 
  end;
 
var
  Form1: TForm1;
 
implementation
 
{$R *.dfm}
 
{ TForm1 }
 
constructor TForm1.Create(AOwner: TComponent);
begin
  inherited Create(AOwner);
  fActiveFrame := nil;
  fFrame2 := nil;
  fFrame3 := nil;
end;
 
function TForm1.GetFrame2: TFrame;
begin
  if not Assigned(fFrame2) then
  begin
    fFrame2 := TFrame.Create(Self);
    fFrame2.Color := clGreen;
  end;
  Result := fFrame2;
end;
 
function TForm1.GetFrame3: TFrame;
begin
  if not Assigned(fFrame3) then
  begin
    fFrame3 := TFrame.Create(Self);
    fFrame3.Color := clRed;
    fFrame3.Align := alClient;
    with TLabel.Create(fFrame3) do
    begin
      Caption := 'Frame3';
      Top := 20;
      Left := 20;
      Parent := fFrame3;
    end;
  end;
  Result := fFrame3;
end;
 
procedure TForm1.SetActiveFrame(const Value: TFrame);
var LastFrame: TFrame;
begin
  LastFrame := fActiveFrame;
  if Assigned(LastFrame) then
    LastFrame.Parent := nil;
  fActiveFrame := Value;
  if Assigned(fActiveFrame) then
    fActiveFrame.Parent := Panel1;
end;
 
procedure TForm1.Button1Click(Sender: TObject);
begin
  ActiveFrame := DisplayFrame2;
end;
 
procedure TForm1.Button2Click(Sender: TObject);
begin
  ActiveFrame := DisplayFrame3;
end;
 
end.

Open in new window

0
Geert GOracle dbaCommented:
why my own example ?

yours wouldn't compile as I don't have all DevExpress modules
in particular dxGDIPlusClasses
0
senadAuthor Commented:
Nothing from devexpress here...Two panels,two frames and two butttons...
dx.. was a leftover and was taken out.
0
senadAuthor Commented:
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, ExtCtrls, StdCtrls;
type
TForm1 = class(TForm)
Panel1: TPanel;
Button2: TButton;
Button1: TButton;
procedure Button1Click(Sender: TObject);
procedure Button2Click(Sender: TObject);
private
fActiveFrame: TFrame;
Frame2: TFrame;
Frame3: TFrame;
function GetFrame2: TFrame;
function GetFrame3: TFrame;
procedure SetActiveFrame(const Value: TFrame);
public
constructor Create(AOwner: TComponent); override;
property DisplayFrame2: TFrame read GetFrame2;
property DisplayFrame3: TFrame read GetFrame3;
property ActiveFrame: TFrame read fActiveFrame write SetActiveFrame;
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
{ TForm1 }
constructor TForm1.Create(AOwner: TComponent);
begin
inherited Create(AOwner);
fActiveFrame := nil;
Frame2 := nil;
Frame3 := nil;
end;

function TForm1.GetFrame2: TFrame;
begin
if not Assigned(Frame2) then
begin
Frame2 := TFrame.Create(Self);
Frame2.Color := clGreen;
Frame2.Align := alClient;
end;
Result := Frame2;
end;

function TForm1.GetFrame3: TFrame;
begin
if not Assigned(Frame3) then
begin
Frame3 := TFrame.Create(Self);
Frame3.Color := clRed;
Frame3.Align := alClient;
end;
Result := Frame3;
end;

procedure TForm1.SetActiveFrame(const Value: TFrame);
var LastFrame: TFrame;
begin
LastFrame := fActiveFrame;
if Assigned(LastFrame) then
LastFrame.Parent := nil;
fActiveFrame := Value;
if Assigned(fActiveFrame) then
fActiveFrame.Parent := Panel1;
end;

procedure TForm1.Button1Click(Sender: TObject);
begin
ActiveFrame := DisplayFrame2;
end;

procedure TForm1.Button2Click(Sender: TObject);
begin
ActiveFrame := DisplayFrame3;
end;

end.
Why do you see a flicker of white on panel1 when clicking buttons??
 
"and none of the descendants you created in Unit2 and Unit3
you are displaying empty, clean, transparent frames !"
correct but >
procedure TForm1.FormCreate(Sender: TObject);
begin
  Frame2 := TFrame2.Create(Self);
  Frame3 := TFrame3.Create(Self);
end;
 does not do the trick... So what should the code (myone)be?
Little tiring doing functions for each frame...
0
Geert GOracle dbaCommented:
Little tiring doing functions for each frame... ?
Then stop programming !
Have you ever condisdered resources like memory ?
If nobody ever pushes Button2 in my example then TFrame3 never gets created (or memory consumed)
But then again, why would you care, you're too tired !
Programming is not only typing (or copy/paste) some text, it's an art !

It's delving in to problems, finding how it works, looking up solutions, reading the help.
And not giving up.

I copied your example and everything works fine !
Have you looked at every piece of code carefully ?
Didn't you miss a single character ?

If you want to see with your own eyes then come over here at my desk and check
I'll even add a screen shot and the whole code, dfm's included, using your example

May the source be with you
Cause i'm nearly giving up

unit Unit1;
 
interface
 
uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, ExtCtrls, StdCtrls;
 
type
  TForm1 = class(TForm)
    Button1: TButton;
    Button2: TButton;
    Panel2: TPanel;
    procedure FormCreate(Sender: TObject);
    procedure Button1Click(Sender: TObject);
    procedure Button2Click(Sender: TObject);
  private
    Frame2: TFrame;
    Frame3: TFrame;
    fActiveFrame: TFrame;
    procedure SetActiveFrame(const Value: TFrame);
  public
    property ActiveFrame: TFrame read fActiveFrame write SetActiveFrame;
  end;
 
var
  Form1: TForm1;
 
implementation
 
{$R *.dfm}
 
Uses Unit2,Unit3;
 
procedure TForm1.SetActiveFrame(const Value: TFrame);
var
  LastFrame : TFrame;
begin
  LastFrame := fActiveFrame;
  fActiveFrame := Value;
  if Assigned(LastFrame) then
    LastFrame.Parent := nil;
  if Assigned(fActiveFrame) then
    fActiveFrame.Parent := Panel2;
end;
 
procedure TForm1.FormCreate(Sender: TObject);
begin
  Frame2 := TFrame2.Create(Self);
  Frame3 := TFrame3.Create(Self);
end;
 
procedure TForm1.Button1Click(Sender: TObject);
begin
  ActiveFrame := Frame2;
end;
 
procedure TForm1.Button2Click(Sender: TObject);
begin
  ActiveFrame := Frame3;
end;
 
end.
 
unit Unit2;
 
interface
 
uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, ExtCtrls;
 
type
  TFrame2 = class(TFrame)
    Panel1: TPanel;
  private
    { Private declarations }
  public
    { Public declarations }
  end;
 
implementation
 
{$R *.dfm}
 
end.
 
unit Unit3;
 
interface
 
uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, 
  Dialogs, StdCtrls;
 
type
  TFrame3 = class(TFrame)
    ListBox1: TListBox;
  private
    { Private declarations }
  public
    { Public declarations }
  end;
 
implementation
 
{$R *.dfm}
 
end.
 
object Form1: TForm1
  Left = 192
  Top = 160
  Width = 870
  Height = 640
  Caption = 'Form1'
  Color = clBtnFace
  Font.Charset = DEFAULT_CHARSET
  Font.Color = clWindowText
  Font.Height = -11
  Font.Name = 'MS Sans Serif'
  Font.Style = []
  OldCreateOrder = False
  OnCreate = FormCreate
  PixelsPerInch = 96
  TextHeight = 13
  object Button1: TButton
    Left = 45
    Top = 25
    Width = 75
    Height = 25
    Caption = 'Button1'
    TabOrder = 0
    OnClick = Button1Click
  end
  object Button2: TButton
    Left = 45
    Top = 65
    Width = 75
    Height = 25
    Caption = 'Button2'
    TabOrder = 1
    OnClick = Button2Click
  end
  object Panel2: TPanel
    Left = 60
    Top = 115
    Width = 586
    Height = 361
    Caption = 'Panel2'
    TabOrder = 2
  end
end
 
object Frame2: TFrame2
  Left = 0
  Top = 0
  Width = 320
  Height = 240
  TabOrder = 0
  object Panel1: TPanel
    Left = 55
    Top = 35
    Width = 196
    Height = 136
    Caption = 'Panel1'
    Color = clRed
    TabOrder = 0
  end
end
 
object Frame3: TFrame3
  Left = 0
  Top = 0
  Width = 320
  Height = 240
  TabOrder = 0
  object ListBox1: TListBox
    Left = 35
    Top = 40
    Width = 236
    Height = 161
    Color = clLime
    ItemHeight = 13
    TabOrder = 0
  end
end

Open in new window

screenshot.png
0
senadAuthor Commented:
Sorry to disapoint you but it does not work.

unit Unit1;
 
interface
 
uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, ExtCtrls, StdCtrls;
 
type
  TForm1 = class(TForm)
    Button1: TButton;
    Button2: TButton;
    Panel2: TPanel;
    procedure FormCreate(Sender: TObject);
    procedure Button1Click(Sender: TObject);
    procedure Button2Click(Sender: TObject);
  private
    Frame2: TFrame;
    Frame3: TFrame;
    fActiveFrame: TFrame;
    procedure SetActiveFrame(const Value: TFrame);
  public
    property ActiveFrame: TFrame read fActiveFrame write SetActiveFrame;
  end;
 
var
  Form1: TForm1;
 
implementation
 
{$R *.dfm}
 
Uses Unit2,Unit3;
 
procedure TForm1.SetActiveFrame(const Value: TFrame);
var
  LastFrame : TFrame;
begin
  LastFrame := fActiveFrame;
  fActiveFrame := Value;
  if Assigned(LastFrame) then
    LastFrame.Parent := nil;
  if Assigned(fActiveFrame) then
    fActiveFrame.Parent := Panel2;
end;
 
procedure TForm1.FormCreate(Sender: TObject);
begin
  Frame2 := TFrame2.Create(Self);
  Frame3 := TFrame3.Create(Self);
end;
 
procedure TForm1.Button1Click(Sender: TObject);
begin
  ActiveFrame := Frame2;
end;
 
procedure TForm1.Button2Click(Sender: TObject);
begin
  ActiveFrame := Frame3;
end;
 
end.

Open in new window

0
Geert GOracle dbaCommented:
did you actually try all my code ?
0
Geert GOracle dbaCommented:
now and then somme funny things happen

Like me giving up on this

Have you seen Achmed, The Dead Terrorist ?
I'm not yelling at my screen the famous words !
"Silence, I ..."
0
senadAuthor Commented:


Of course I tried....
(by the way,in your nice picture,what's a panel doing on a frame ?)
Ahmed is lucky...I am banging my head on the monitor asking myself how comes it works for him and not for me?.
'resources like memory ' ...you really miss the old DOS days,aren't you??
Did you try and compile my code,actually?
0
Geert GOracle dbaCommented:
what's a panel doing on a frame ?

you can design frames any which way you like
you can put a lot of components on a panel
(just like a form actually)

when you right click on the Frame in the Frame/Form Editor
you have the menu option "Add to component palette"
This puts the Frame and *all* it's components on the component palette

When you open a new form, click on the just created component
in the component palette and then click in you form
you will have the frame and all it's components in this new form

How did you think frames were being used ?
0
Geert GOracle dbaCommented:
I can't compile your code !!!

I don't have units 2 and 3 !!!
0
senadAuthor Commented:
Well.to get those units use "New" - "New Frame"  :-)
Once you get them please do (and I mean :do) trie and compile.
No more pictures,please...
0
Geert GOracle dbaCommented:
i'm not the novice at Delphi here.
if you can't get it to work, i'll be happy to come over and show what yer doing wrong
you just need to mail me the airplane ticket, cab fare and hotel fare for 1 night.

I posted you a complete working sample.
If you can't get this sample to work then there is no point to continue.

The pictures were proof it actually works.





0
senadAuthor Commented:
The question was why my code does not work,not yours...
0
Geert GOracle dbaCommented:
Your code doesn't work because something is obviously wrong with it.
That's why i gave you a *working* example.
You can use it to start and copy your code into it.

Go 1 step/event/procedure at a time, untill you get to the error.
0
senadAuthor Commented:
No,this is not it...
0
Geert GOracle dbaCommented:
senad, I'm giving up on you and frames.
I tried explaining with hands, feet, face, everything.
Obviously you just don't grasp it, do you ?

put you project in .zip, put it on EE-stuff and people can take a look at it.

You're not gonna get any further like this !
0
senadAuthor Commented:
That first code was not my code anyway...I found it posted somewhere...dont remember where...
It seemed to me a good idea (so you do not have to do a 'frame.hide and frame.show stuff)
Tried it and it dont seem to work.That is why I tried to have some help with that very same code (in case I was doing something wrong).Since I am a noobie in programming I allways try and find something new,to discover how things work.
As for the frames,I think I am going to give up on them to...Seems a nice idea at first but the more you get into them the more limitations you find.(Also found a nice example at codegear how to put frames on tab control).All in all I found it to be the best practice to use forms.


0
Geert GOracle dbaCommented:
frame have some pitfalls, especially when modifying the ancestor and deleting controls
0
Geert GOracle dbaCommented:
well, maybe but the question has been answered.
Because of all the effort i put into this, i object to deletion
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Delphi

From novice to tech pro — start learning today.