Board index » delphi » Resizable fields in Delphi 1

Resizable fields in Delphi 1

Could anybody point my in the right direction as to where I might be
able to find out how to make a resizable field in Delphi 1?  For
example,  I am using a listbox, and a THeader in conjunction with each
other, and I have three fields in the header:

Here is the THeader Enlarged :)
+------------------------------------------------------------------+
|                |                         |                       |
| Name           | Date                    | Subject               |
+------------------------------------------------------------------+

I want the list box to be able to hold the three sepertate strings, on
one horizontal line.

eg:

  Mike             09/28/1996                test subject

When I resize the THeader's Name item, I  want the listbox to resize the
area that holds the name string etc.. I don't know even how to begin
this process.  Any suggestions?

btw:  if you don't understand a single word of what I just wrote, a good
example of what I am trying to do is in the Netscape News reader.  There
is a Sender Field, and a Subject field, and a date field.  when you
resize the sender field, the name string get's bigger or smaller.  If
smaller the name looks like : Mi...
if you resize the Subject field, the Subject string enlarges, or
shrinks....and so on.

Thanks For putting up with my grammer, and horrible writing skills :)
Mike

Please reply by e-mail

--
 -- Everyone has desires to see what lies behind locked doors...
    Censorship suckS!
    Graphic Illusions - http://www.netcom.com/~g-illus

 

Re:Resizable fields in Delphi 1


Quote
Mike wrote:

> Could anybody point my in the right direction as to where I might be
> able to find out how to make a resizable field in Delphi 1?  For
> example,  I am using a listbox, and a THeader in conjunction with each
> other, and I have three fields in the header:

Instead, use StringGrid without lines.
Ali

Re:Resizable fields in Delphi 1


Quote
Mike wrote:

> Could anybody point my in the right direction as to where I might be
> able to find out how to make a resizable field in Delphi 1?  For
> example,  I am using a listbox, and a THeader in conjunction with each
> other, and I have three fields in the header:
> ....

Hi,

I am not sure that I understood your problem correctly but here's
something:

It seems to me that you should be using a TStringGrid instead of a
listbox.  The TStringGrid can have fixed rows that act exactly the way
you want.  If you like the THeader component you can still use it and
place the following code in the OnSized event:

For i:=0 to Header1.Sections.count-1 do
        Begin
   StringGrid1.ColWidths[i]:=Header1.SectionWidth[i];
 end;

This will adjust each column in the grid to the siz of the corresponding
Header section.  Note: You may need to add or subtract something from
the sectionWidth values depending on the size of the grid lines you are
using (if any).

This assumes that the StringGrid has as many columns as the heaer and
that it doesn't allow horizontal scrolling.  It you need that, you will
probably be better off using the StringGrid fixed rows.

Hope this helps.

Alain Toutant
a.tout...@sympatico.ca

Other Threads