LB Booster
« Grid of textboxes »

Welcome Guest. Please Login or Register.
Apr 1st, 2018, 03:50am



ATTENTION MEMBERS: Conforums will be closing it doors and discontinuing its service on April 15, 2018.
We apologize Conforums does not have any export functions to migrate data.
Ad-Free has been deactivated. Outstanding Ad-Free credits will be reimbursed to respective payment methods.

Thank you Conforums members.
Speed up Liberty BASIC programs by up to ten times!
Compile Liberty BASIC programs to compact, standalone executables!
Overcome many of Liberty BASIC's bugs and limitations!
LB Booster Resources
LB Booster documentation
LB Booster Home Page
LB Booster technical Wiki
Just BASIC forum
BBC BASIC Home Page
Liberty BASIC forum (the original)

« Previous Topic | Next Topic »
Pages: 1  Notify Send Topic Print
 thread  Author  Topic: Grid of textboxes  (Read 226 times)
Richard Russell
Administrator
ImageImageImageImageImage


member is offline

Avatar




Homepage PM


Posts: 1348
xx Grid of textboxes
« Thread started on: Jul 12th, 2016, 09:56am »

One of the most useful features of LBB is the ability to create child controls in a loop. User Turtleman asked this question at the LB Community Forum:

Quote:
I'm now trying to construct a GUI having 60 input blocks consisting of 20 rows and 3 columns. On each row, the first block (column 1) contains a number from 1 to 500, representing dollars. The next two blocks on each row (columns 2 and 3) represent Pass or Fail and are populated with numbers 1-20

There's no simple way of doing that in LB but it's straightforward in LBB:

Code:
    WindowHeight = 700
    for row = 1 to 20
      textbox #w.tb, 10, row*30, 30, 20
      maphandle #w.tb, "#w.tb1.";row
      textbox #w.tb, 50, row*30, 20, 20
      maphandle #w.tb, "#w.tb2.";row
      textbox #w.tb, 80, row*30, 20, 20
      maphandle #w.tb, "#w.tb3.";row
    next row
    open "Grid test" for window as #w
    for row = 1 to 20
      h$ = "#w.tb1.";row
      #h$ str$(int(500*rnd(1))+1)
      h$ = "#w.tb2.";row
      #h$ str$(int(20*rnd(1))+1)
      h$ = "#w.tb3.";row
      #h$ str$(int(20*rnd(1))+1)
    next row
    wait  

Perhaps somebody can give the OP this information.

Richard.
User IP Logged

Pages: 1  Notify Send Topic Print
« Previous Topic | Next Topic »

| |

This forum powered for FREE by Conforums ©
Terms of Service | Privacy Policy | Conforums Support | Parental Controls