Solved

Rich Text Box Editing

Posted on 2000-03-27
5
185 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
  • 2
  • 2
5 Comments
 
LVL 28

Accepted Solution

by:
AzraSound earned 100 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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
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 Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
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…

743 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now