Hi Everybody
Im fairly new to .net i am after some help with a function. I have put this code into a click procedure however what i want it to do is put it in a function or class so i can call it whenever i like. This is the code
Only to put this code in a function i have no idea how to do it ive tried several ways unsuccessfully, not sure if i can have an array in a fucntion or not. I would like it if somebody could please help me writing this as a function
thank you
MRRX8
Im fairly new to .net i am after some help with a function. I have put this code into a click procedure however what i want it to do is put it in a function or class so i can call it whenever i like. This is the code
Code:
Dim Litem As New ListViewItem
Dim totea As Integer
Dim ctrl As Control
Dim iCtrl, iChk, iTotalEA As Integer
Dim bb() As BoxedBird
For iCtrl = 0 To Panel1.Controls.Count - 1
ctrl = Panel1.Controls(iCtrl)
If ctrl.GetType Is GetType(System.Windows.Forms.TextBox) Then
ReDim Preserve bb(iCtrl)
bb(iCtrl).SIZE = ((CType(ctrl, TextBox).Tag))
iChk = modFunctions.CheckTextBoxForString((CType(ctrl, TextBox).Text))
bb(iCtrl).Boxed = iChk
iTotalEA = modFunctions.CalculateTotalBirdEach(iChk, (CType(ctrl, TextBox).Tag))
bb(iCtrl).bTotal = iTotalEA
totea = totea + iTotalEA
End If
Next
'Populate whats in the array iterate
Dim i As Integer
Dim LItem1 As ListViewItem
For i = 0 To bb.GetUpperBound(0)
LItem1 = lvBoxed.Items.Add(bb(i).SIZE)
LItem1.SubItems.Add(bb(i).Boxed)
LItem1.SubItems.Add(bb(i).bTotal)
Next
Litem.ForeColor = (Color.Green)
Litem.Text = UCase(dsf.sSize)
Litem.SubItems.Add(dsf.dWeight)
Litem.SubItems.Add(dsf.iCount)
Litem.SubItems.Add(dsf.dAvSizeWeight)
Litem.SubItems.Add(dsf.dBoxedWeight)
Litem.SubItems.Add(dsf.dCutUpSizeTotalKg)
Litem.SubItems.Add(dsf.dTotalSizeMaryland)
Litem.SubItems.Add(dsf.dTotalSizeWholeBreast)
Litem.SubItems.Add(dsf.dTotalSizeWings)
Litem.SubItems.Add(dsf.dTotalSizeBRFillet)
Litem.ImageIndex = 0
lvStockDetails.Items.Add(Litem)
Only to put this code in a function i have no idea how to do it ive tried several ways unsuccessfully, not sure if i can have an array in a fucntion or not. I would like it if somebody could please help me writing this as a function
thank you
MRRX8