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
Solved

Front Page Type Look

Posted on 1998-11-10
4
145 Views
Last Modified: 2010-04-30
Dear Experts,
   Can someone please explain to me, how to get the effect displayed in Microsoft Front Page 97+ under the html view?  I want to use a richtextbox and i would like to have my program automaticly change the color of the different html tags without lagging the user.  Please respond.
-CompGuy-
0
Comment
Question by:CompGuy
  • 2
  • 2
4 Comments
 
LVL 12

Accepted Solution

by:
mark2150 earned 50 total points
ID: 1444193
You need to scan in the HTML as you place it into the RTB. When you see a marker in the HTML that you want to take action on, change the .SelColor property before appending the text.

I'd set up a table with tags and colors or use a SELECT CASE to make your color choice decisions.

Write if you need code for color change and/or text append.

M

0
 

Author Comment

by:CompGuy
ID: 1444194
Thanks for the reply.  First off, it sounds like you have the answer, but since I have just started using RTB's, Actually doing what your saying is a little hard.  Would you mind a simple example?  I'm going to fool around with what you've said so far to see if i can't get it for myself, but if not, I would appreciate a sample.. Thanks.
-CompGuy-
0
 
LVL 12

Expert Comment

by:mark2150
ID: 1444195
Well, the hardest part is in scanning the HTML. You have to recognise *all* tags - even the ones you *DON'T handle.

The RichTextBox has a series of Selxxxx properties, Bold, Italic, Underline, Color, etc One you set 'em all additional text passed into the control assumes that property state.

Sooooo. You have to scan the raw HTML and watch for your codes: <B>, <U>, <I>, etc. and then adjust the state of the RTB's SelBold, SelUnderline, SelItalic, etc. properties to match. You'll also have to watch for the end codes. Imagine something like:

SELECT CASE Token
    CASE "<B>"
        RTB.SelBold = True
    CASE "<U>"
        RTB.SelUnderline = True
    CASE "<I>"
        RTB.SelItalic = True
    CASE "</B>"
        RTB.SelBold = False
    CASE "</U>"
        RTB.SelUnderline = False
.
    CASE ELSE
END SELECT

etc, etc, etc,

I can give you a form that edits a RTB and saves it to disk. It tracks all of the .SEL params. It controls them from a menu, but your code code set them as shown above.

The tricky part is what to do with unhandled HTML.

M

0
 

Author Comment

by:CompGuy
ID: 1444196
Okay, i kinda see what your saying.  That for would help though.. Could you send it to CompGuy2@aol.com?  Thanks.
-CompGuy-
0

Featured Post

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

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

Suggested Solutions

Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
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…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

856 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