Download the free trial version
Basic4android Video
Features
Tutorials and manuals
Showcase
Screenshots

Go Back   Android Development Forum - Basic4android > Basic4ppc (Windows Mobile) > Basic4ppc Wishlist
Documentation Wiki Register Members List B4P Search Today's Posts Mark Forums Read

Basic4ppc Wishlist Missing any feature?

control references

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 12-28-2007, 04:04 AM
Newbie
 
Join Date: Nov 2007
Posts: 7
Question control references

I have a need to reference control properties using a numeric index e.g.

for x = 1 to 10
control(x).text = table1.text
control(x).color = cRed
next

(where control(x) is a row of 10 columns of 'boxes' that I want to place single characters and color the 'box' with a separate color depending on the contents of the 'box'. there are also 5 rows, so altogether there are 70 'boxes' which I need to reference in a sililar fashion.)

but I get compiler errors when I do this. Would really like a feature that does this, otherwise it's a very complicated set of individual lines of code to say the list!
Reply With Quote
  #2 (permalink)  
Old 12-28-2007, 06:41 AM
Erel's Avatar
Administrator
 
Join Date: Apr 2007
Posts: 15,689
Awards Showcase
Basic4ppc Founder 
Total Awards: 1
Default

Just name your controls b1 -> b70 and then use:
For x = 1 to 70
Control("b" & x).Text = ...
Next

This tutorial may help you: http://www.basic4ppc.com/forum/tutorials/907-runtime-controls-manipulation.html
Reply With Quote
  #3 (permalink)  
Old 12-29-2007, 12:41 AM
Newbie
 
Join Date: Nov 2007
Posts: 7
Default

Thanks - Silly me! I should RTFM! (Read The Flaming Manual!!)
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 Off
Pingbacks are Off
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Passing references to tables to subs LineCutter Questions (Windows Mobile) 5 05-31-2007 08:27 PM


All times are GMT. The time now is 10:58 AM.


Powered by vBulletin® Version 3.6.12
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0