Re: ListView w. vertical (or angled) ColumnHeader

Tech-Archive recommends: Fix windows errors by optimizing your registry

From: alpine (alpine_don'tsendspam_at_mvps.org)
Date: 05/14/04


Date: Fri, 14 May 2004 08:12:51 -0600

On Fri, 14 May 2004 04:06:04 -0700, Joe
<anonymous@discussions.microsoft.com> wrote:

>> What I mean is, the text of the header should be vertical (or angled),
> like you can
> > do it in Excel. The ColumnHeader should be on the top of the ListView (or
> Grid).
>
> You'd have to use a third-party component. VB doesn't come with something
> like this.
>
>Thanks, this is I also know. Actually I was hoping for links to some resources,
>which would one show, how to create such a ColumnHeader (for e.g. a ListView)...

To do this with the listview, you would need to subclass WM_PAINT
message for the header and draw the rotated text yourself. The trick
to getting the header large enough to draw vertical text (or text at
an angle) is to set the font size for the header large enough to
create the desired amount of space for your desired text in the
rotated font you will be using.

HTH,
Bryan
____________________________________________________________
New Vision Software "When the going gets weird,"
Bryan Stafford "the weird turn pro."
alpine_don'tsendspam@mvps.org Hunter S. Thompson -
Microsoft MVP-Visual Basic Fear and Loathing in LasVegas