Basic4ppc - Windows Mobile Development  

Go Back   Basic4ppc - Windows Mobile Development > Main Category > Questions & Help Needed
Home Register FAQ Members List Search Today's Posts Mark Forums Read

Questions & Help Needed Post any question regarding Basic4ppc.


TextBox, Index & Arraylist


Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 11-19-2007, 02:59 PM
Newbie
 
Join Date: Nov 2007
Posts: 2
Default TextBox, Index & Arraylist

Good Afternoon to everybodies!

I've a little problem, obviously.

I've 81 TextBox and I need to write everyone at same time using a For cicle.
In VB6 I can draw every TextBox with same name and use an index (Index).
I don't find that in Basic4ppc... I suppose using ArrayList but I don't know this object

Example
If I was 3 TextBox1:
TextBox1(0)
TextBox1(1)
TextBox1(2)

It should have to sound so (this code is a mix between B4ppc and Index like VB6):

Sub Button1_Click
For i =0 to 2
TextBox1(i).Color = cRed
Next i
End Sub

Sub Button2_Click
For i =0 to 2
TextBox1(i).Color = cGreen
Next i
End Sub


Thax!
Reply With Quote
  #2 (permalink)  
Old 11-19-2007, 03:18 PM
Erel's Avatar
Administrator
 
Join Date: Apr 2007
Posts: 3,134
Default

This tutorial will help you: Runtime controls manipulation

If you've named your textboxes: TextBox1, TextBox2... you can use:
Code:
For i = 1 to n
 Control("TextBox" & i).Color = cRed
Next
Reply With Quote
  #3 (permalink)  
Old 11-19-2007, 03:25 PM
Senior Member
 
Join Date: Apr 2007
Location: Copenhagen
Posts: 141
Default TextBox, Index & Arraylist

Dear Peptone,

you can use the Control keyword (see the helpfile)

In your example you could have three different textboxes
TextBox1
TextBox2
TextBox3

and then change the color as below

Sub Button1_Click
For i =1 to 3
Control("TextBox"&i).Color = cRed
Next i
End Sub

and so on.

all the best / Björn


Editing:
Arrgh, too late... Erel, you got there first as usual
Reply With Quote
  #4 (permalink)  
Old 11-19-2007, 04:58 PM
Newbie
 
Join Date: Nov 2007
Posts: 2
Default

Thanks a lot!

It's more simple than I belived!

... and more simple then VB too!
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
retrieve images and index lux1963 Questions & Help Needed 3 05-18-2008 02:42 PM
Addrow like removerow(index) Vito Questions & Help Needed 3 02-04-2008 02:09 PM
Arraylist tvrman Questions & Help Needed 7 07-01-2007 11:42 AM
Index problem in the IF statement markus Questions & Help Needed 2 06-03-2007 02:10 PM
Index was out of range error in version 5 HARRY Questions & Help Needed 6 05-20-2007 09:16 AM


All times are GMT. The time now is 03:26 AM.


Powered by vBulletin® Version 3.6.12
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.1.0