Solved

Rich Text Box Editing

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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
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…

751 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