• Welcome to Theos PowerBasic Museum 2017.

VB6 Control Array alternative for PowerBasic? Looping through a few controls?

Started by Christian McDonald, July 18, 2009, 08:37:54 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Christian McDonald

Is there a way to loop through controls? Kinda like VB6 control arrays?

Patrice Terrier

Patrice Terrier
GDImage (advanced graphic addon)
http://www.zapsolution.com

José Roca

 
It depends in what you mean with loop (I have no idea of what VB6 does). If it means to navigate from one to another using the tab key, then you must add the %WS_TABSTOP style to the controls and call the IsDialogMessage function in the message pump.

Christian McDonald

here is some vb6 code:



Dim i as Long

for i = txtTextBox1.LBound to txtTextBox1.UBound

  txtTextBox1(i).Text = str$(i)

next i




José Roca

For that you will need to use the EnumChildWindows function, retrieve the class name and if the class is "Edit" then set the text using the SetWindowText function. See an EnumChildWindows example here: http://www.jose.it-berater.org/smfforum/index.php?topic=728.0