how to calculate the value for listView subitems? [modified]
-
dear all i am a newbie in vb6, so far i entountered a problem, how to calculate the value for listview subitem, my part code is here, anyone can help me, thanks a lot. actually i am calculating the pixel amount in each index: for example: index value: 0, 1, 2 ...255. when i click Button Execute in form frmHistogram: the code is following:
Private Sub cmdExecute_Click()
'Execute the computingEasyMain1.Histogram EBW8Image1.object, frmHistogramVector.EBWHistogramVector1.object frmHistogramVector.EBWHistogramVector1.Refresh frmHistogramVector.Show
End Sub
and i wanna put the variable a as my subitem value, the code is the following:
Private Sub Form_Load()
Dim Min As Long Dim Max As Long Min = 0 Max = 255 With ListView1 .ColumnHeaders.Add 'add a couple columns .ColumnHeaders.Add .ColumnHeaders(1).Text = "Index" 'name the columns .ColumnHeaders(2).Text = "Count" .ColumnHeaders(1).Width = .Width \* 0.35 'column width based on width of list view .ColumnHeaders(2).Width = .Width \* 0.5 Dim I As Long Dim a As Single With .ListItems For I = 0 To 255 a = EasyMain1.AnalyseHistogram(EBWHistogramVector1.object, eImgPixelCount, 0, 255) With .Add(, , I) .ListSubItems.Add , , a End With Next I End With End With
End Sub
however when i run program, one popup dialog remind me: invalid number of vector elements. what is problem here. thanks.
modified on Monday, April 13, 2009 10:19 PM
-
dear all i am a newbie in vb6, so far i entountered a problem, how to calculate the value for listview subitem, my part code is here, anyone can help me, thanks a lot. actually i am calculating the pixel amount in each index: for example: index value: 0, 1, 2 ...255. when i click Button Execute in form frmHistogram: the code is following:
Private Sub cmdExecute_Click()
'Execute the computingEasyMain1.Histogram EBW8Image1.object, frmHistogramVector.EBWHistogramVector1.object frmHistogramVector.EBWHistogramVector1.Refresh frmHistogramVector.Show
End Sub
and i wanna put the variable a as my subitem value, the code is the following:
Private Sub Form_Load()
Dim Min As Long Dim Max As Long Min = 0 Max = 255 With ListView1 .ColumnHeaders.Add 'add a couple columns .ColumnHeaders.Add .ColumnHeaders(1).Text = "Index" 'name the columns .ColumnHeaders(2).Text = "Count" .ColumnHeaders(1).Width = .Width \* 0.35 'column width based on width of list view .ColumnHeaders(2).Width = .Width \* 0.5 Dim I As Long Dim a As Single With .ListItems For I = 0 To 255 a = EasyMain1.AnalyseHistogram(EBWHistogramVector1.object, eImgPixelCount, 0, 255) With .Add(, , I) .ListSubItems.Add , , a End With Next I End With End With
End Sub
however when i run program, one popup dialog remind me: invalid number of vector elements. what is problem here. thanks.
modified on Monday, April 13, 2009 10:19 PM
Are you stuck supporting an existing VB6 program or are you creating a new app?
Never underestimate the power of human stupidity RAH
-
Are you stuck supporting an existing VB6 program or are you creating a new app?
Never underestimate the power of human stupidity RAH