Solved

Rich Text Box Editing

Posted on 2000-03-27
5
191 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 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

SharePoint Admin?

Enable Your Employees To Focus On The Core With Intuitive Onscreen Guidance That is With You At The Moment of Need.

Question has a verified solution.

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

Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
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…
Suggested Courses
Course of the Month8 days, 3 hours left to enroll

617 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