LB Booster
Programming >> Language extensions >> Creating multiple controls in a loop
http://lbb.conforums.com/index.cgi?board=extensions&action=display&num=1423233360

Creating multiple controls in a loop
Post by Richard Russell on Feb 6th, 2015, 1:36pm

Somebody over at the Liberty BASIC Community Forum is asking about how to create multiple controls in a loop. It's not possible in LB4.04 but it is possible in LBB using MAPHANDLE:

Code:
  for box = 1 to 10
    statictext #WIN.st, str$(box), 95, 78 + box*20, 18, 20
    textbox #WIN.tb1, 115, 72 + box*20, 350, 25
    textbox #WIN.tb2, 461, 72 + box*20, 40, 25
    stylebits #WIN.tb2, _ES_RIGHT, 0, 0, 0
    maphandle #WIN.st, "#WIN.statictext";box
    maphandle #WIN.tb1, "#WIN.TEXT";box
    maphandle #WIN.tb2, "#WIN.TEXT";box;".TEMP"
  next
  WindowWidth = 600
  open "Looped controls" for window as #WIN
  wait 


That code creates this window:

User Image

Perhaps somebody with access to the LB forum could tell the OP about this option.

Richard.
Re: Creating multiple controls in a loop
Post by Cor on Feb 12th, 2015, 8:06pm

That somebody from Conforums is writing this reply. I've just gotten back into the coding loop. Been out of it for about two and a half years.

I was glad to see rtr respond to my question. Like so many people, I have given up on getting a quick new release of LB to help solve my problems. Such a shame that a released beta has an expiration date. An American would say: DUH?? The 'in a few days' inevitably turns into at least weeks if not months, so this is a welcome solution. Thank you Russell.