Board index » delphi » Displaying records in a listbox ??

Displaying records in a listbox ??

Hello,
I try to revise a database programmed in Delphi 2.0.
Parts of a record from a database (like name, prename,adress,.. )should
be displayed in a Listbox window, but displaying these records cause
problems:

It seems difficult to arrange the records clearly.

Can I use the column-property from TListbox, if so how?, or is there
another possibility??

Thank you in advance for your help.

Martin Meier

 

Re:Displaying records in a listbox ??


Quote
>Hello,
>I try to revise a database programmed in Delphi 2.0.
>Parts of a record from a database (like name, prename,adress,.. )should
>be displayed in a Listbox window, but displaying these records cause
>problems:

>It seems difficult to arrange the records clearly.

>Can I use the column-property from TListbox, if so how?, or is there
>another possibility??

>Thank you in advance for your help.

>Martin Meier

Hi Martin,

If you must use a listbox try something like this:

while Table1.Eof = False do
   begin
       ListBox1.Items.Add(Table1.FieldByName('Name').AsString +
           ', ' + Table1.FieldByName('prename').AsString + '  ' +
            Table1.FieldByName(address));
       Table1.Next;
   end;

It would be much easier however to use a DBGrid...

********************************
Michael Glatz              
glatzfa...@aol.com
mgl...@briefcase.com
Accept that some days you're the pigeon,
some days you're the statue.

Re:Displaying records in a listbox ??


it would be great to use Info Power DBwwLookupList: very useful
(and all the other components too)

Quote
Glatzfamly wrote:
> >Hello,
> >I try to revise a database programmed in Delphi 2.0.
> >Parts of a record from a database (like name, prename,adress,.. )should
> >be displayed in a Listbox window, but displaying these records cause
> >problems:

> >It seems difficult to arrange the records clearly.

> >Can I use the column-property from TListbox, if so how?, or is there
> >another possibility??

> >Thank you in advance for your help.

> >Martin Meier

> Hi Martin,

> If you must use a listbox try something like this:

> while Table1.Eof = False do
>    begin
>        ListBox1.Items.Add(Table1.FieldByName('Name').AsString +
>            ', ' + Table1.FieldByName('prename').AsString + '  ' +
>             Table1.FieldByName(address));
>        Table1.Next;
>    end;

> It would be much easier however to use a DBGrid...

> ********************************
> Michael Glatz
> glatzfa...@aol.com
> mgl...@briefcase.com
> Accept that some days you're the pigeon,
> some days you're the statue.

  sasha.vcf
< 1K Download

Re:Displaying records in a listbox ??


it would be great to use Info Power DBwwLookupList: very useful
(and all the other components too)

Quote
Glatzfamly wrote:
> >Hello,
> >I try to revise a database programmed in Delphi 2.0.
> >Parts of a record from a database (like name, prename,adress,.. )should
> >be displayed in a Listbox window, but displaying these records cause
> >problems:

> >It seems difficult to arrange the records clearly.

> >Can I use the column-property from TListbox, if so how?, or is there
> >another possibility??

> >Thank you in advance for your help.

> >Martin Meier

> Hi Martin,

> If you must use a listbox try something like this:

> while Table1.Eof = False do
>    begin
>        ListBox1.Items.Add(Table1.FieldByName('Name').AsString +
>            ', ' + Table1.FieldByName('prename').AsString + '  ' +
>             Table1.FieldByName(address));
>        Table1.Next;
>    end;

> It would be much easier however to use a DBGrid...

> ********************************
> Michael Glatz
> glatzfa...@aol.com
> mgl...@briefcase.com
> Accept that some days you're the pigeon,
> some days you're the statue.

  sasha.vcf
< 1K Download

Re:Displaying records in a listbox ??


Quote
>it would be great to use Info Power DBwwLookupList: very useful
>(and all the other components too)

Does Info Power's stuff support Delphi 2?  That is what the original poster is
using.

********************************
Michael Glatz              
glatzfa...@aol.com
mgl...@briefcase.com
Accept that some days you're the pigeon,
some days you're the statue.

Other Threads