Re: VB6.exe abort after system rebuild?

From: thejamie (thejamie_at_discussions.microsoft.com)
Date: 09/30/04


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..
>



Relevant Pages

  • Re: Modules not Known
    ... Dim pCode$ ... Dim pCodeModule As CodeModule ... Private Sub VBIDEReference() ... Option Compare Database ...
    (comp.databases.ms-access)
  • A VB6 program to generate CONSTants for a user defined gradient
    ... EndProperty ... It may be used for amy moral purpose. ... Dim mGreen1 As Long ... Private Sub ColorDisplay_MouseDown(Button As Integer, Shift As Integer, _ ...
    (comp.lang.basic.visual.misc)
  • Re: access 2003
    ... Dim ctl As Control ... Dim rs As Recordset ... This sets the query definitions for choosing data to create an invoice using ... Event on combo box: Private Sub ChooseCust_AfterUpdate ...
    (microsoft.public.access.conversion)
  • Re: Gradient Generator BMP Tool Improved
    ... EndProperty ... It may be used for amy moral purpose. ... Dim mGreen1 As Long ... Private Sub ColorDisplay_MouseDown(Button As Integer, Shift As Integer, _ ...
    (comp.lang.basic.visual.misc)
  • Calendar Control issue.
    ... Protected WithEvents Calendar1 As System.Web.UI.WebControls.Calendar ... Private Sub Page_Init(ByVal sender As System.Object, ... Dim mo As String ...
    (microsoft.public.dotnet.framework.aspnet)