The following code from the LVARROWS example on the source forum works fine except for how it handles right aligned listview columns.
The following code section from that source code example causes the right aligned column to become left aligned including the data. Would anyone have a way to code this to put the icon on the left of the text instead of the right?
Bob Mechler
The following code section from that source code example causes the right aligned column to become left aligned including the data. Would anyone have a way to code this to put the icon on the left of the text instead of the right?
Code:
'¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤ '* Set the header icons based on the active column (index) and the sort order '¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤ SUB SetHeaderIcons(BYVAL iActiveColumn AS INTEGER, BYVAL iSortOrder AS INTEGER) LOCAL i AS INTEGER LOCAL hdi AS HD_ITEM LOCAL iAlignRight AS INTEGER LOCAL iAlignLeft AS INTEGER FOR i = 0 TO Header_GetItemCount(ghLvHdr) - 1 'Go through each column header hdi.mask = %HDI_FORMAT OR %HDI_IMAGE Header_GetItem ghLvHdr, i + 1, hdi iAlignRight = (hdi.fmt = %HDF_RIGHT) hdi.fmt = %HDF_STRING OR (iAlignRight AND %HDF_RIGHT) IF i = iActiveColumn THEN hdi.fmt = hdi.fmt OR %HDF_IMAGE OR ((iAlignRight = %FALSE) AND %HDF_BITMAP_ON_RIGHT) END IF hdi.iImage = iSortOrder CALL Header_SetItem(ghLvHdr, i, hdi) NEXT END SUB
Comment