Solved

Front Page Type Look

Posted on 1998-11-10
4
138 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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
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…
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…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

705 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

21 Experts available now in Live!

Get 1:1 Help Now