BlackBerry Forums Support Community
              

Closed Thread
 
LinkBack Thread Tools
Old 03-15-2010, 06:18 AM   #1 (permalink)
New Member
 
Join Date: Mar 2010
Model: 7100t
PIN: N/A
Carrier: dnt no
Posts: 5
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default Diffrent text colour in same string

Please Login to Remove!

Hi I have a string of text which will be constantly changing since It downloads every time you start the app, but that is not the problem I just want you to know the situation.

Know the string holds a series of information in the same format such as name, date, status etc. So how do I change the colour of only one part of the string and use a different colour for other parts. I will oly need three colours.

I don't think that creating three text fields with diffrent colous will help, as the string neds to be rendered in the order it is in.

I thought perhaps finding a key value in the string such as a word which I can do between each part of the series, and then creating a new rich text field whith an asigned colour depending on a value in the string? However I do not know how to do that.

Please help, thanks.
Offline  
Old 03-15-2010, 10:09 AM   #2 (permalink)
Knows Where the Search Button Is
 
Join Date: Mar 2010
Model: N/A
PIN: N/A
Carrier: Fledge
Posts: 43
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

I think you are looking for advice on basic string parsing functions. Look at the String functions "substring" and "indexOf" at API Reference: String Class which can be used to find the position of text in a string and create a new string based on the starting and ending position parameters.
Offline  
Closed Thread


Thread Tools

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

Backlight LCD Digital Thermometer 2-Channel Type K/J Thermocouple Sensor A6X3
$16.36
Backlight LCD Digital Thermometer 2-Channel Type K/J Thermocouple Sensor A6X3 pictureDigital Industrial Thermocouple Thermometer HVAC Stainless Steel PT100 Probe
$40.0
Digital Industrial Thermocouple Thermometer HVAC Stainless Steel PT100 Probe pictureTaylor 9405 High Accuracy Waterproof K Type Thermocouple Thermometer
$99.95
Taylor 9405 High Accuracy Waterproof K Type Thermocouple Thermometer pictureMultimeter Cable For Fluke 80BK-A Type Mini K Thermocouple DMM Probe Cable
$9.88
Multimeter Cable For Fluke 80BK-A Type Mini K Thermocouple DMM Probe Cable pictureEmerson H06E-18 Universal Thermocouple, 18-inch
$6.8
Emerson H06E-18 Universal Thermocouple, 18-inch picture






Copyright 2004-2016 BlackBerryForums.com.
The names RIM and BlackBerry are registered Trademarks of BlackBerry Inc.