Delphi Pages Forums  

Go Back   Delphi Pages Forums > Delphi Forum > General

Lost Password?

Reply
 
Thread Tools Display Modes
  #1  
Old 01-19-2001, 02:46 AM
PoseFant PoseFant is offline
Senior Member
 
Join Date: Jan 2001
Posts: 1,002
Default Problems with Components ...

Hi all ...

I'm sending a request to a Module to fill up a TreeView.

Request(TreeView);

As long as the TreeView has a Form as it's parent it is working great ...

But ...

If I place the TreeView on a PageControl ... *hehe* ...

Nothing happens ...

So ... I tried to set TReeView.Parent := PageControl;

It worked ... But the graphics bugged ... not surprising ...

Further I tried TreeView.Parent := PageControl.PageIndex[IndexOfTHePageWhereIWantedTheTrreView];

woops ...

nothing happened ...

The Module statement is this ...

Procedure Request(TreeList : TTreeNodes);
Var
RootNode,
CurrentNode : TTreeNode;
Begin
TreList.Clear;
RootNode := TreeList.Add(NiL,'Header');
CurrentNode := TreeList.AddChild(RootNode,'Information');
TreeList.AddChild(CurrentNode,'Further Information');
End;


Any Ideas ?


Thx in advance ...


Regards

/Filip
Reply With Quote
  #2  
Old 01-19-2001, 06:12 AM
MrBaseball34 MrBaseball34 is offline
Senior Member
 
Join Date: Jan 2001
Posts: 7,260
Default RE: Problems with Components ...

Try this:

procedure Request(TreeList : TTreeNodes);
var
RootNode,
CurrentNode : TTreeNode;
begin
TreeList.Clear;
RootNode := TreeList.Add(niL,'Header');
CurrentNode := TreeList.AddChild(RootNode,'Information');
TreeList.AddChild(CurrentNode,'Further Information');
end;

procedure TForm1.Button1Click(Sender: TObject);
begin
Request(TreeView1.Items);
end;

It doesn't matter where the Treeview is, you were passing
the wrong thing in the parameter to Request.
Reply With Quote
  #3  
Old 01-20-2001, 08:27 AM
PoseFant PoseFant is offline
Senior Member
 
Join Date: Jan 2001
Posts: 1,002
Default RE: RE: Problems with Components ...

hehe ... sorry ... I'm using the syntax you described ...

Request(TreeView.Items);

And get the error as described ... )
As long as I place the TreeView on a PageControl ...

/Filip
Reply With Quote
  #4  
Old 01-22-2001, 05:17 AM
MrBaseball34 MrBaseball34 is offline
Senior Member
 
Join Date: Jan 2001
Posts: 7,260
Default RE: RE: RE: Problems with Components ...

That is not what your original question stated:

Request(TreeView);

procedure Request(TreeList : TTreeNodes);

I tried this with a treeview placed ON A TPAGECONTROL, and
it worked fine for me. there must be something else you are
doing that is causing the error.
Reply With Quote
  #5  
Old 01-22-2001, 05:26 AM
PoseFant PoseFant is offline
Senior Member
 
Join Date: Jan 2001
Posts: 1,002
Default RE: RE: RE: RE: Problems with Components ...

I Know ... "Typical Error" ... I forgot ".Items" ... memory leak in my brains ... ;o)

Hmmm ...

Gotta check over my code again ...

Thx so far ...

/Filip
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On

Forum Jump


All times are GMT. The time now is 04:01 AM.


Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2019, vBulletin Solutions, Inc.