VFP Multi line grid headers

VFP Multi line grid headers

Post by Stuart Fairfu » Mon, 25 Mar 1996 04:00:00



Has anyone found a way to have column headers in grids spanning more than
one line?  You can alter the header height to anything you want, but I
can't find any way of using this space effectively.  Embedding
CHR(13)+CHR(10) doesn't work here.   TIA.

Stuart Fairful
Bytemark Ltd
Glasgow
+44 (141) 226 4890

 
 
 

VFP Multi line grid headers

Post by Jon Farle » Tue, 26 Mar 1996 04:00:00



> You will like this (not).  Super kludge by courtesy of Microsoft Knowledge
> Base Q133164.

> Cheers

> Mike

If you had any plans of allowing the grid columns to be resize by the user, give it
up with this kludge! I cannot understand why MS didn't just make the header contain
a label? Then it would have the textwrap property and others.

Jon

 
 
 

VFP Multi line grid headers

Post by Mike Cha » Tue, 26 Mar 1996 04:00:00



>Has anyone found a way to have column headers in grids spanning more than
>one line?  You can alter the header height to anything you want, but I
>can't find any way of using this space effectively.  Embedding
>CHR(13)+CHR(10) doesn't work here.   TIA.

Hello Stuart,

You will like this (not).  Super kludge by courtesy of Microsoft Knowledge
Base Q133164.

--------------------------------------------------
1. Create a form.

2. From the Form Controls toolbar, select the Grid object, and place a
   grid on the form.

3. In the Property sheet, modify the Columncount property of the grid to
   2.

4. In the Property sheet, change the HeaderHeight to 45, and set the
   column's header to a blank space, as follows:

   Grid1.HeaderHeight = 45
   Grid1.Column1.Header1.Caption = " "

5. Change the Caption property of Header1, contained in Column1:

   Caption= " "  &&Press the Spacebar and Click the check mark

6. Select the Label control from the Form Controls toolbar, and place a
   label on top of the header.

7. In the Property sheet, change the following properties for the label
   control:

   BackStyle:  0-Transparent

8. On the Caption property, click the Fx button. In the expression
   builder,
   type:

   "First Line" + CHR(13) + "Second Line"

9. Save and run the form.

The header in the first column of the grid displays a two-line caption.

Copyright (c) Microsoft Corporation. All rights reserved.

--------------------------------------------------

Cheers

Mike

----------------------------------------------------------------------
Mike Chalk   ASAD SYSTEMS Ltd.                   C/Foxpro26/VFP/Delphi

----------------------------------------------------------------------

 
 
 

VFP Multi line grid headers

Post by Mike Cha » Wed, 27 Mar 1996 04:00:00



>Agreed, Jon.  Not just resizing and moving, but also horizontal scrolling
>of the grid puts the kybosh on the label 'solution'.  Ho hum.  One for
>the wish list, then.

And the good fairy said your wish SHALL be granted.  Well, only
if you are a control freak and you don't like your users to be able to
change their column widths. Set the column Resizable property to .F., get
rid of the horizontal scroll bar and make sure that your displayed columns
all lie within the grid width.  Seriously, most of my grids are designed
that way. Partly because I am mean but mostly because I usually want the
user to see all the information available and not expect them to have to
mess around with column widths or scroll to view hidden data.  Of course
there are exceptions when I want to unleash the full power of the column
width resizing and horizontal scrolling.

For instances where I can freeze the columns then I might be happy to use
the multi line label kludge.  I am not happy though - it is a fiddly
process which is hard to maintain.  The smallest change in layout means
you have to carefully re-align the labels.  Ugggghhhh, it would be like
writing an app with some ghastly primitive system like FPW 2.6 and Windows
3.11.

OK Stuart, let's start wishing.

----------------------------------------------------------------------
Mike Chalk   ASAD SYSTEMS Ltd.                   C/Foxpro26/VFP/Delphi

----------------------------------------------------------------------

 
 
 

VFP Multi line grid headers

Post by Stuart Fairfu » Wed, 27 Mar 1996 04:00:00


Agreed, Jon.  Not just resizing and moving, but also horizontal scrolling
of the grid puts the kybosh on the label 'solution'.  Ho hum.  One for
the wish list, then.

Stuart Fairful
Bytemark Ltd
Glasgow
+44 (141) 226 4890