Board index » cppbuilder » A Listbox like Component that can accept TPanel as it items

A Listbox like Component that can accept TPanel as it items


2005-06-29 08:39:03 PM
cppbuilder12
Hi,
I am looking for a component like listbox that can accept "TPanel" as it's
component.
In my program, the user has the option of creating upto 600 nodes. Each node
has many properties.
When the user add a new node, a Tpanel is created.It should be added to the
listbox like control so that the user can scroll down through all the nodes
created. The user can manually change the postion of the TPanel in the
listbox by drag-drop operation.
Is there any component available that can do it?
Thank you
Regards,
Siraj
 
 

Re:A Listbox like Component that can accept TPanel as it items

siraj wrote:
Quote
I am looking for a component like listbox that can accept "TPanel" as it's
component.
Place a TScrollBox and a TButton on a TForm and try this:
void __fastcall TForm1::Button1Click(TObject *Sender)
{
int maxpanels = 10;
int panelnr = -1;
while ( ++panelnr < maxpanels )
{
TPanel *Panel = new TPanel ( ScrollBox1 );
Panel->Caption = IntToStr ( panelnr );
Panel->Align = alTop;
Panel->Top = Panel->Height * panelnr;
Panel->Parent = ScrollBox1;
}
}
Of cource you have to implement an OnClick handler for every panel too.
For further questions use the ..vcl.components.using newsgroup.
Hans.