The information in this article applies to:
SYMPTOMSWhen you programmatically set the Width of a ColumnHeader, the width of the column may actually appear larger than you expect. This presents a problem when you attempt to save the ColumnHeader Width settings so that you can restore them at a later time. CAUSE
Internally, the Width of a ColumnHeader is padded with some predetermined
constant when it is changed programmatically. This padding is not in effect
if the Width of the ColumnHeader is changed through the user interface.
RESOLUTION
To work around this problem, you can set or return a ColumnHeader Width
using the SendMessage API function with the LVM_SETCOLUMNWIDTH or
LVM_GETCOLUMNWIDTH messages.
To set the Width of a Columnheader using the message LVM_SETCOLUMNWIDTH, you provide the index of the column (starting with 0) as the wParam and the new width as the lParam. For example, the following statement sets the width of the second column (index 1) of ListView1 to 150:
To retrieve the Width of a Columnheader using the message LVM_GETCOLUMNWIDTH, you provide the index of the column (starting with 0) as the wParam. The lParam is unused and should be set to 0. For example, the following statement returns the width of the second column (index 1) of ListView1:
STATUSMicrosoft has confirmed this to be a bug in the Microsoft products listed at the beginning of this article. This bug has been fixed in Visual Basic 6.0. MORE INFORMATIONSteps to Reproduce Behavior
Additional query words:
list view comctl32 column width kbVBp500bug kbVBp600fix kbVBp
Keywords : kbGrpVB |
Last Reviewed: January 5, 2000 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |