Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Rich Text Box Editing

Posted on 2000-03-27
5
Medium Priority
?
193 Views
Last Modified: 2010-05-02
How do I change the text in a Rich Text Box?
I want to be able to search through the RTB and use If and Then statments to manipulate strings found in it...

Here's the problem
RTB text
define names                = 10   L
define Pay                  =  6   $
bye
Daniel     $1000
Ronald      $100
Alisha      $101
Adam        $321

I want to become

names     Pay    
Daniel     $1000
Ronald      $100
Alisha      $101
Adam        $321

The "bye" in the text file means it is finished defining the field.
The number following the Define represents the number of spaces between the fields.
Sorry, if it doesn't look aligned..
This is because of the font use on this website.  There is 10 character spaces from the "n" to the "P" on the first line.
The "L" represent Left justification..
and the "$" means number which is automaticlly means it's right justified.
Some code would help out a lot.
Thanks.
0
Comment
Question by:aomega
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
5 Comments
 
LVL 28

Accepted Solution

by:
AzraSound earned 200 total points
ID: 2663041
you can use the Find method to find and replace words in the rtb control.  For example:
RichTextBox1.Find ("define",0, ,rtfNoHighlight)
This will find the word 'define' without highlighting it. But I dont think this will be nearly sufficient enough for what you wish to do. Question I have:
How uniform will this be? In other words, how versatile does the code need to be?  How many fields could there be, etc.

The formatting you wish to do will be rather complex. If I find some time I will work out some code for your simple example.

   
0
 

Expert Comment

by:TheMask
ID: 2663357
Can you discuss more, please
0
 
LVL 14

Expert Comment

by:wsh2
ID: 2663367
As your data is columnar, I think you will find a MSFlexgrid may be more suitable for your purposes. With it.. you can add pictures, and format / size cells, rows, and columns discretely
If you wanna know more.. give a shout.. <smile>.
0
 
LVL 14

Expert Comment

by:wsh2
ID: 2664446
Gosh Azra.. a C?.. Aomega has a very tough grading curve.. particularily when you consider that you offered more assistance.. <sigh>. Oh well.. such is life.. congrats on solving the question.. <smile>.
0
 
LVL 28

Expert Comment

by:AzraSound
ID: 2664948
hey I feel like I'm back in college this way   =)
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Suggested Courses

670 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question