I am using 46 btns to make a grid onscreen and I was wondering how do I send the Button name in the following code
If PLUDataResult.Count > 0 Then
For Each PLUDataResult
Global.pluNumber[PLUDataResult!button_number] = PLUDataResult!plulistid
Global.pluBarcode[PLUDataResult!button_number] = PLUDataResult!barcode
Global.PLUKeyName[PLUDataResult!button_number] = PLUDataResult!description
Global.PLUKeyType[PLUDataResult!button_number] = PLUDataResult!listtype
If PLUDataResult!button_image <> "" Then
Global.pc = Picture.FromString(FromBase64(PLUDataResult!button_image))
Else
Global.pc = Picture.FromString(File.Load(Application.Path &/ "fkeys/blankkey.bmp"))
End If
Global.ImageFromString(Global.pc, BUTTONAMEHERE, Global.PLUKeyName[PLUDataResult!button_number])
Select Case PLUDataResult!listtype
Case "L" ' List
BUTTONAMEHERE.Background = Color.Yellow
Case "D" ' Direct sale Items
BUTTONAMEHERE.Background = Color.Red
End Select
Next
End If
Where it have inserted BUTTONAMEHERE I would need to repalce that with the frmPLUList.Btn1 to frmPLUList.Btn46
Can I some how have a const "frmPLUList.Btn" and then and the PLUDataResult!button_number to it so it would show like
frmPLUList.Btn1.Background = Color.Yellow (this is only needed at runtime) I am still looping though each option but this is taking a while to load so any ideas as how to optimize this would be most welcomed.
Andy