Solved

Front Page Type Look

Posted on 1998-11-10
4
148 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
[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
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: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering 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

There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
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…

728 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