[Sloved] Programmly send Button Name
Posted
#1
(In Topic #1203)
Enthusiast

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
Code (gambas)
- 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
- Global.ImageFromString(Global.pc, BUTTONAMEHERE, Global.PLUKeyName[PLUDataResult!button_number])
- BUTTONAMEHERE.Background = Color.Yellow
- BUTTONAMEHERE.Background = Color.Red
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
Posted
Guru

Code (gambas)
- BuildForm
- Dim sPicts As String[] = ["access", "add", "align-bottom", "align-center", "align-height", "align-left", "align-middle", "align-right", "align-top", "align-width", "apply", "archive", "attach", "audio", "battery", "book", "bookmark", "bottom", "c", "calculator", "calendar", "call", "camera", "cancel", "cdrom", "clear", "clock", "close", "color-picker", "color", "component", "computer", "connect", "copy", "cpp", "css", "cut", "database", "delete", "desktop", "development", "directory", "disconnect", "down", "download", "earth"]
- .W = 1000
- .H = 475
- .Arrangement = Arrange.Vertical
- .Padding = 5
- .H = 56
- .W = 100
- .H = 28
- iColour = Rand(0, 1)
- .Background = [Color.Red, Color.Yellow][iColour]
- Inc iCount
Posted
Guru

Posted
Enthusiast

1 guest and 0 members have just viewed this.



