Re: VB6.exe abort after system rebuild?
From: thejamie (thejamie_at_discussions.microsoft.com)
Date: 09/30/04
- Next message: David Hodgkins: "Encrypting variables"
- Previous message: Ken Halter: "Re: Cannot change Scrollbars property - how to change Wrap?"
- Next in thread: thejamie: "Re: VB6.exe abort after system rebuild?"
- Maybe reply: thejamie: "Re: VB6.exe abort after system rebuild?"
- Reply: Ken Halter: "Re: VB6.exe abort after system rebuild?"
- Reply: Ken Halter: "Re: VB6.exe abort after system rebuild?"
- Messages sorted by: [ date ] [ thread ]
Date: Thu, 30 Sep 2004 08:17:03 -0700
> Addressed... but not resolved. Especially on XP. If you want a visit
> from Dr. Watson, try rearranging columns in a SP6 ListView at runtime.
Ken,
Can you provide an example. I have an app where I am, I think, rearranging
the columns at runtime: (seems to work ok under sp6, so I am curious to see
what you are doing)
(Help on this came from Randy Birch's sight so I give credit where credit is
due - thanks Randy)
Private Sub LoadData(nSizingType As ImageSizingTypes)
Dim cnt As Long
Dim itmx As ListItem
Dim ors As ADODB.Recordset
With ListView1
.ListItems.Clear
.ColumnHeaders.Clear
.ColumnHeaders.Add , , "Number"
.ColumnHeaders.Add , , "Part"
.ColumnHeaders.Add , , "Product Category"
.ColumnHeaders.Add , , "Surcharge "
.ColumnHeaders.Add , , "Description"
.View = lvwReport
.Sorted = False
End With
'/* Create some fake data
mCatalog.Filter = "DIVISION Like '" & vDivAbbr(cboDivision.ListIndex -
1) & "%'"
Do While Not mCatalog.EOF
cnt = cnt + 1
Set itmx = FrEORGANIZE.ListView1.ListItems.Add(, , Format$(cnt, "###"))
If nSizingType = sizeIcon Then itmx.SmallIcon = 1
itmx.SubItems(1) = mCatalog!Type ' Format$(Time, "hh:mm:ss am/pm")
itmx.SubItems(2) = mCatalog!Update
itmx.SubItems(3) = mCatalog!surcharge
itmx.SubItems(4) = mCatalog!Desc
' itmx.SubItems(4) = mCatalog!DIVISION
mCatalog.MoveNext
Loop
'/* Now that the control contains data, this
'/* causes the columns to resize to fit the items
Call lvAutosizeControl(FrEORGANIZE.ListView1)
End sub
Private Sub lvAutosizeControl(lv As ListView)
Dim col2adjust As Long
'/* Size each column based on the maximum of
'/* EITHER the columnheader text width, or,
'/* if the items below it are wider, the
'/* widest list item in the column
For col2adjust = 0 To lv.ColumnHeaders.Count - 1
Call SendMessage(lv.hwnd, _
LVM_SETCOLUMNWIDTH, _
col2adjust, _
ByVal LVSCW_AUTOSIZE_USEHEADER)
Next
End Sub
> Ken Halter - MS-MVP-VB - http://www.vbsight.com
> Please keep all discussions in the groups..
>
- Next message: David Hodgkins: "Encrypting variables"
- Previous message: Ken Halter: "Re: Cannot change Scrollbars property - how to change Wrap?"
- Next in thread: thejamie: "Re: VB6.exe abort after system rebuild?"
- Maybe reply: thejamie: "Re: VB6.exe abort after system rebuild?"
- Reply: Ken Halter: "Re: VB6.exe abort after system rebuild?"
- Reply: Ken Halter: "Re: VB6.exe abort after system rebuild?"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|